From a7ebf4cd9b04498325d2369d396a5a5bca9db2c3 Mon Sep 17 00:00:00 2001 From: Jay Quan Date: Wed, 10 Apr 2024 13:16:23 +0200 Subject: [PATCH] chore: removed PR_APPROVE_TOKEN and replace it with auto-approve-action package (#1165) --- .github/workflows/auto-merge-dependabot.yaml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/auto-merge-dependabot.yaml b/.github/workflows/auto-merge-dependabot.yaml index e2bc273a7..f080ac373 100644 --- a/.github/workflows/auto-merge-dependabot.yaml +++ b/.github/workflows/auto-merge-dependabot.yaml @@ -1,4 +1,4 @@ -name: Dependabot auto-merge +name: Dependabot approve and merge on: pull_request_target @@ -24,20 +24,9 @@ jobs: ## NOTE: This step is only required if the repository has been configured to Require approval ## Checks if update-type is patch or minor, then approve if the PR status is not approved yet. - ## Token with PR approval permission is required - - name: Approve patch and minor updates + - name: Auto approve patch and minor updates + uses: hmarr/auto-approve-action@v4 if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}} - run: | - gh pr checkout "$PR_URL" - if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; - then - gh pr review --approve "$PR_URL" - else - echo "PR already approved."; - fi - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.PR_APPROVE_TOKEN}} ## NOTE: Requirements for merge has to be configured in the Branch protection rule page. ## To do so, go to repository > Settings > Branches > Edit.