# The adRise/update-pr-branch action has force-pushed an empty branch to outside contributions # before (e.g. https://github.com/emmercm/igir/pull/943), causing the PR to merge but no code to # actually end up in the main repository. This action is to automatically disable auto-merge in # case this ever gets enabled again. name: GitHub Auto-Merge Disabler on: pull_request_target: types: - edited jobs: disable-auto-merge: if: ${{ github.event.pull_request.auto_merge && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} permissions: # actions/checkout@v4, `gh` CLI contents: write # `gh` CLI repository-projects: read pull-requests: write runs-on: ubuntu-latest steps: # Required for `gh` CLI - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - run: gh pr merge "${{ github.event.pull_request.number }}" --disable-auto env: GH_TOKEN: ${{ github.token }} - uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1 with: message: | ## :warning: Disabling auto-merge Auto-merge is problematic for outside contributions. A maintainer will need to merge this pull request manually. _Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._ mode: recreate comment-tag: gh-automerge-disabler remove-comment: if: ${{ !github.event.pull_request.auto_merge || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} permissions: pull-requests: write runs-on: ubuntu-latest steps: - uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1 with: message: Deleting mode: delete comment-tag: gh-automerge-disabler