diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index dbf007a..6f3a2b9 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -40,16 +40,13 @@ jobs: steps: - name: Dependabot metadata id: dependabot-metadata - uses: dependabot/fetch-metadata@v1 - - name: Approve a PR if not already approved + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve and merge run: | - gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status` - if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; - then gh pr review --approve "$PR_URL" - else echo "PR already approved, skipping additional approvals to minimize emails/notification noise."; - fi - - gh pr merge --merge --rebase "$PR_URL" + gh pr review --approve "$PR_URL" + gh pr merge --rebase --delete-branch "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}