From 6faf50fb9b049ba528c7e35ee916f802b0036ee6 Mon Sep 17 00:00:00 2001 From: chris3ware <36608309+chris3ware@users.noreply.github.com> Date: Wed, 26 Mar 2025 14:21:20 +0000 Subject: [PATCH] feat(pr-check): Add auto-approve job for renovate PRs --- .github/workflows/wait-for-checks.yaml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wait-for-checks.yaml b/.github/workflows/wait-for-checks.yaml index 4d3a4ecc..4af1b53c 100644 --- a/.github/workflows/wait-for-checks.yaml +++ b/.github/workflows/wait-for-checks.yaml @@ -27,17 +27,15 @@ jobs: # For example if the calling workflow job name is 'Checks' the path to ignore is 'Checks / enforce-all-checks' ignore_pattern: .*\/ (enforce-all-checks|auto-approve-pr) - # Approve PR raised by 3ware-release[bot] to upgrade trunk on trunk branches or by 3ware-terraform[bot] on project branches - # This job will only run if enforce-all-checks job has passed successfully on pull requests. This workflow could be called by - # a merge_group event: in this case it should not run - # auto-approve-pr: - # if: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'auto-approve') }} - # needs: [enforce-all-checks] - # runs-on: ubuntu-latest - # timeout-minutes: 5 - # steps: - # - name: Auto Approve PR - # uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 - # with: - # github-token: ${{ secrets.PR_APPROVAL_PAT }} - # review-message: All checks passed. Auto Approved. + # Approve PR raised by renovate bot + auto-approve-pr: + needs: [enforce-all-checks] + if: ${{ github.actor == 'renovate[bot]' && github.event_name == 'pull_request_target' }} + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Auto Approve PR + uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 + with: + github-token: ${{ secrets.PR_APPROVAL_PAT }} + review-message: All checks passed. Auto Approved.