Skip to content

Commit

Permalink
🤖 Auto approve provider release PRs (#4844)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker authored Nov 12, 2024
1 parent 001ee01 commit b8014a3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,29 @@ jobs:
fail-on-alert: true
save-data-file: false
alert-threshold: '150%'

go-auto-approve:
runs-on: ubuntu-latest
needs: [golangci-lint, go-test, go-test-integration, go-bench, go-mod]
# For now, we only auto approve and merge provider release PRs created by mondoo-tools.
# We have to check the commit author, because the PR is created by "github-actions[bot]"
# 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/version/providers_update_') && github.event.commits[0].author.username == 'mondoo-tools' }}
permissions:
contents: write
pull-requests: write
steps:
# figure out the PR for this commit
- uses: cloudposse-github-actions/[email protected]
id: pr
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
filterOutClosed: true
filterOutDraft: true
- name: Approve a PR
uses: fastify/github-action-merge-dependabot@v3
with:
pr-number: ${{ steps.pr.outputs.number }}

event_file:
name: "Store event file"
Expand Down

0 comments on commit b8014a3

Please sign in to comment.