Skip to content

Fix: don't orphan children when filtering out parents #4

Fix: don't orphan children when filtering out parents

Fix: don't orphan children when filtering out parents #4

# 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
permissions:
# actions/checkout@v4, `gh` CLI
contents: write
# `gh` CLI
repository-projects: read
pull-requests: write
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 }}
runs-on: ubuntu-latest
steps:
# Required for `gh` CLI
- uses: actions/checkout@v4
- run: gh pr merge "${{ github.event.pull_request.number }}" --disable-auto
env:
GH_TOKEN: ${{ github.token }}
- uses: thollander/actions-comment-pull-request@v2
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 }}
runs-on: ubuntu-latest
steps:
- uses: thollander/actions-comment-pull-request@v2
with:
message: Deleting
mode: delete
comment_tag: gh-automerge-disabler