Skip to content

Commit

Permalink
Avoid reviewing own PRs by auto-merging with bot token
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbalinov committed Nov 27, 2024
1 parent 42a2719 commit 2478cfa
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,19 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"
filterOutClosed: true
filterOutDraft: true
- 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}}

# fetch a token for the mondoo-mergebot app
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.MONDOO_MERGEBOT_APP_ID }}
private_key: ${{ secrets.MONDOO_MERGEBOT_APP_PRIVATE_KEY }}
# automerge using bot token
- uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: squash
token: ${{ steps.generate-token.outputs.token }}
event_file:
name: "Store event file"
runs-on: ubuntu-latest
Expand Down

0 comments on commit 2478cfa

Please sign in to comment.