Skip to content

Commit

Permalink
Avoid reviewing own PRs by auto-merging with bot token (#1499)
Browse files Browse the repository at this point in the history
* Avoid reviewing own PRs by auto-merging with bot token

* Switch to official create-github-app-token action

* Revert to manual gh execution
  • Loading branch information
philipbalinov authored Nov 28, 2024
1 parent 42a2719 commit f1912dd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,20 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"
filterOutClosed: true
filterOutDraft: true
# fetch a token for the mondoo-mergebot app
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v1
with:
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 --merge
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

GH_TOKEN: ${{ steps.generate-token.outputs.token }}
event_file:
name: "Store event file"
runs-on: ubuntu-latest
Expand Down

0 comments on commit f1912dd

Please sign in to comment.