diff --git a/.github/workflows/pr-test-lint.yml b/.github/workflows/pr-test-lint.yml index cad6b31f..8c74f611 100644 --- a/.github/workflows/pr-test-lint.yml +++ b/.github/workflows/pr-test-lint.yml @@ -90,10 +90,10 @@ jobs: go-auto-approve: runs-on: ubuntu-latest - needs: go-test + needs: [go-test, go-bench, golangci-lint, go-mod] # For now, we only auto approve and merge go dep PRs because we have tests for this in place. # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#startswith - if: ${{ startsWith(github.ref, 'refs/heads/dependabot/go_modules') && github.actor == 'dependabot[bot]' && needs.go-test.outputs.outcome == 'success' }} + if: ${{ startsWith(github.ref, 'refs/heads/dependabot/go_modules') && github.actor == 'dependabot[bot]' }} permissions: contents: write pull-requests: write @@ -106,12 +106,9 @@ jobs: filterOutClosed: true filterOutDraft: true - name: Approve a PR - # Settings the comment will auto merge the PR after all tests passed - # https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates#managing-dependabot-pull-requests-with-comment-commands - run: gh pr review "$PR_URL" --approve --body "@dependabot squash and merge" - env: - PR_URL: ${{ steps.pr.outputs.url }} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + uses: fastify/github-action-merge-dependabot@v3 + with: + pr-number: ${{ steps.pr.outputs.number }} event_file: name: "Store event file"