Repository navigation
ci: add a merge guard check for the do-not-merge label - #523
Merged
Merged
Conversation
|
Automatic reviews are disabled for this repository. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
A pull request that must not merge yet has no visible marker beyond a comment, and the
do-not-mergelabel does nothing on its own.Change
A
Merge guardcheck fails while thedo-not-mergelabel is on..github/workflows/merge-guard.ymlruns on pull requests intodev,testandprod, onopened,reopened,synchronize,labeledandunlabeled. It reads the label list from the event payload throughenvandjq, checks nothing out and holds an empty token. An unreadable list fails the job instead of passing it.It is a workflow of its own. Adding the label events to
ci.ymlwould rerun lint, tests, end-to-end and SonarCloud at every label click. This job takes seconds and starts nothing else.The CI section of
docs/environments.mdlists it. The same edit corrects the sentence above it:devrequiresCheckalready.Verification
uvx --from actionlint-py actionlint .github/workflows/merge-guard.yml: clean. Therun:body executed on six label payloads:do-not-mergepresent exits 1, other labels and[]exit 0,null, invalid JSON and empty input exit non-zero with an annotation.Merge guardbecomes a required check ondevafter this merges, and the label blocks a merge from then on.Migrations
None.
Screenshots
None.