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 dep bump and provider release PRs #4958

Merged
merged 1 commit into from
Dec 5, 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
18 changes: 14 additions & 4 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
# 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' }}
if: ${{ (startsWith(github.ref, 'refs/heads/version/providers_update_') || startsWith(github.ref, 'refs/heads/version/deps_update_')) && github.event.commits[0].author.username == 'mondoo-tools' }}
permissions:
contents: write
pull-requests: write
Expand All @@ -191,10 +191,20 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"
filterOutClosed: true
filterOutDraft: true
- name: Approve a PR
uses: fastify/github-action-merge-dependabot@v3
# fetch a token for the mondoo-mergebot app
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v1
with:
pr-number: ${{ steps.pr.outputs.number }}
app-id: ${{ secrets.MONDOO_MERGEBOT_APP_ID }}
private-key: ${{ secrets.MONDOO_MERGEBOT_APP_PRIVATE_KEY }}
# automerge using bot token
- name: Approve and merge a PR
run: |
gh pr review ${{ steps.pr.outputs.number }} --approve
gh pr merge ${{ steps.pr.outputs.number }} --squash
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

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