Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Auto approve provider release PRs #4844

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just letting you both know @benr @philipbalinov that we are using this new GH action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have this already in cnspec and packer-plugin repo

with:
pr-number: ${{ steps.pr.outputs.number }}

event_file:
name: "Store event file"
Expand Down
Loading