Skip to content

ci: add workflow to block merging PRs with "status: blocked" label#5955

Open
mostafaNazari702 wants to merge 1 commit into
mochajs:mainfrom
mostafaNazari702:fix/5924-blocked-pr-check
Open

ci: add workflow to block merging PRs with "status: blocked" label#5955
mostafaNazari702 wants to merge 1 commit into
mochajs:mainfrom
mostafaNazari702:fix/5924-blocked-pr-check

Conversation

@mostafaNazari702
Copy link
Copy Markdown
Contributor

PR Checklist

Overview

A small "Blocked PR Check" workflow that just fails when a PR has the status: blocked label. It runs on normal PR events and when labels get added or removed, so it re-checks whenever someone toggles that state. to actually stop the kind of accidental merges that came up in #5409/#5881, it also needs to be set as a required status check in branch protection i think, that part ain’t handled in the repo itself it has to be configured at the admin level

Comment thread .github/workflows/blocked-pr.yml Outdated
echo "::error::This PR has the 'status: blocked' label and cannot be merged until that label is removed."
exit 1
fi
echo "PR is not blocked."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically does what https://github.com/marketplace/actions/verify-pull-request-labels already does. WDYT about using that -or another existing popular one- instead? I would prefer to reuse that if possible.

This job as-is is pretty clean, but there often end up being odd edge cases & UX niceties that known actions tend to have solved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to check compatibility of the one you suggested and also try to find, possibly, a more better and "popular" but what you suggested is also good but never hurts to have more choices!

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author waiting on response from OP or other posters - more information needed label May 16, 2026
A “Blocked PR Check” workflow that runs on pull request events (including label changes) and fail whenever a PR has the `status: blocked` label. blocked pull requests can not accidentally pass required checks and get manually merged in anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting for author waiting on response from OP or other posters - more information needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🛠️ Repo: Prevent manual merging of PRs labelled "blocked"

2 participants