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
This commit is contained in:
Michael McLoughlin
2023-03-05 20:32:25 -08:00
committed by GitHub
parent 34ac353c14
commit 5935b03afd

View File

@@ -5,6 +5,7 @@ on:
pull_request: pull_request:
jobs: jobs:
automerge: automerge:
if: github.actor == 'cadobot[bot]' && !github.event.pull_request.draft
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Generate Bot Token - name: Generate Bot Token
@@ -14,7 +15,6 @@ jobs:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }} private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Automerge Bot Pull Requests - name: Automerge Bot Pull Requests
if: github.actor == 'cadobot[bot]' && !github.event.pull_request.draft
run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}" run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
env: env:
GITHUB_TOKEN: ${{ steps.bot.outputs.token }} GITHUB_TOKEN: ${{ steps.bot.outputs.token }}