Files
avo/.github/workflows/pr.yml
Michael McLoughlin 5935b03afd ci: skip entire autoland job for non-bot users (#382)
In contributor PRs such as #372 we see that the pr/autoland job fails
due to permissions issues obtaining an app token from a fork.

This job is actually only required to auto-land bot PRs. Instead of
skipping just the auto-land setting step, we should be skipping the
entire thing.

Fixes #381
2023-03-05 20:32:25 -08:00

21 lines
631 B
YAML

name: pr
permissions:
contents: read
on:
pull_request:
jobs:
automerge:
if: github.actor == 'cadobot[bot]' && !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Generate Bot Token
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c # v1.7.0
id: bot
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Automerge Bot Pull Requests
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ steps.bot.outputs.token }}