From 75adb76e237b26dc1a6d127c6d2a87995c05dd38 Mon Sep 17 00:00:00 2001 From: Chris Harrison <36608309+chris3ware@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:58:31 +0000 Subject: [PATCH] feat(checks): Add auto-approve job for trunk upgrade PRs (#120) --- .github/workflows/wait-for-checks.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wait-for-checks.yaml b/.github/workflows/wait-for-checks.yaml index 95fa084..d765167 100644 --- a/.github/workflows/wait-for-checks.yaml +++ b/.github/workflows/wait-for-checks.yaml @@ -1,7 +1,7 @@ name: Checks on: - pull_request: + pull_request_target: types: [opened, edited, synchronize] branches: [main] @@ -23,3 +23,17 @@ jobs: uses: poseidon/wait-for-status-checks@6988432d64ad3f9c2608db4ca16fded1b7d36ead # v0.5.0 with: token: ${{ secrets.GITHUB_TOKEN }} + + # Approve PR raised by 3ware-release[bot] to upgrade trunk on trunk branches + # after all checks have passed. + auto-approve-pr: + needs: [enforce-all-checks] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Auto Approve PR + if: ${{ github.actor == '3ware-release[bot]' && github.head_ref == 'trunk-io/update-trunk' }} + uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 + with: + github-token: ${{ secrets.PR_APPROVAL_PAT }} + review-message: All checks passed. Auto Approved.