From 24baee2e8af851c00a5ae81a9fe5652b3de5e1b8 Mon Sep 17 00:00:00 2001 From: Cody Brittain <1779662+Generalcamo@users.noreply.github.com> Date: Sat, 21 Feb 2026 12:17:35 -0500 Subject: [PATCH] Add workflow to enforce merge blockers on PRs (#21880) No User Facing changes. Avoids accidental merges when the Do Not Merge, Maintainer Discussion, or Lore Discussion labels are set on a PR. [Credit to Baystation for the inspiration.](https://github.com/Baystation12/Baystation12/pull/35046) --------- Signed-off-by: Cody Brittain <1779662+Generalcamo@users.noreply.github.com> --- .github/workflows/enforce_merge_blockers.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/enforce_merge_blockers.yaml diff --git a/.github/workflows/enforce_merge_blockers.yaml b/.github/workflows/enforce_merge_blockers.yaml new file mode 100644 index 00000000000..b579d6d115e --- /dev/null +++ b/.github/workflows/enforce_merge_blockers.yaml @@ -0,0 +1,34 @@ +name: "'Do Not Merge' Blockers" + +on: + pull_request: + types: [synchronize, opened, labeled, unlabeled] + +jobs: + donotmerge-blocker: + name: Enforce Do Not Merge Labels + runs-on: ubuntu-latest + steps: + - name: Enforce Maintainer Discussion Label + if: contains(github.event.pull_request.labels.*.name, '⛔ Maintainer Discussion') + run: | + echo "Pull request is labelled Maintainer Discussion, and must be approved by the maintainers before this PR can be merged." + exit 1 + + - name: Enforce Lore Discussion Label + if: contains(github.event.pull_request.labels.*.name, '⛔ Lore Discussion') + run: | + echo "Pull request is labelled Lore Discussion, and must be approved by the relevant lore team before this PR can be merged." + exit 1 + + - name: Enforce Do Not Merge Label + if: contains(github.event.pull_request.labels.*.name, '🚫 Do Not Merge') + run: | + echo "Pull request is labelled Do Not Merge and cannot be merged in this state. Refer to the developer who set this label for information." + exit 1 + + - name: Enforce Changes Required Label + if: contains(github.event.pull_request.labels.*.name, 'Changes Required') + run: | + echo "Pull request is labelled Changes Required and cannot be merged in this state. Refer to the developer who set this label for information." + exit 1