Preventing maintainer docs from automerging if marked with "do-not-merge" label#5111
Open
WhitWaldo wants to merge 5 commits into
Open
Preventing maintainer docs from automerging if marked with "do-not-merge" label#5111WhitWaldo wants to merge 5 commits into
WhitWaldo wants to merge 5 commits into
Conversation
…ptable when they're marked with the "do-not-merge" label. Automatically runs whenever a label is removed in case the do-not-merge is removed (prompting immediate merge if conditions are acceptable) Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
If an "automerge: " label is applied and the changes in the PR don't correspond to the directory of the applied label, the label will be removed and the automerge will not happen. If an SDK maintainer comes along and applies an "automerge: " label for an SDK they're not a maintainer of, the label will be removed and the automerge will not happen If anyone at all comes along and applies an "automerge: " label and they're not part of the maintainer group corresponding with the label, the label will be removed and the automerge will not happen. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the SDK docs auto-merge GitHub Actions workflow to support maintainer-driven automerge labeling, add a “do-not-merge” safety guard, and re-run on label changes so merge eligibility can be recalculated as labels change.
Changes:
- Extends
pull_request_targettriggers to includelabeled/unlabeledevents. - Splits eligibility logic into (a) “maintainer-approved via automerge label” and (b) “author is SDK maintainer” flows, with optional unauthorized-label removal.
- Adds a merge-time block to prevent merging when a
do-not-mergelabel is present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+73
to
+77
| if (action === 'labeled') { | ||
| // --- Maintainer-approved flow --- | ||
| // A maintainer adds an automerge label to a PR they didn't necessarily author. | ||
| // Validate: label is a known automerge label, adder is in that team, PR only | ||
| // touches that SDK's directory. |
Comment on lines
+202
to
+206
| // Block if "do-not-merge" label is present | ||
| const currentLabels = context.payload.pull_request.labels.map(l => l.name.toLowerCase()); | ||
| if (currentLabels.includes('do-not-merge')) { | ||
| core.info('PR has "do-not-merge" label; skipping merge until it is removed.'); | ||
| return; |
Contributor
There was a problem hiding this comment.
Can you check if this is relevant @WhitWaldo? I think the likelyhood of this one is very small.
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.
Thank you for helping make the Dapr documentation better!
Please follow this checklist before submitting:
In addition, please fill out the following to help reviewers understand this pull request:
Description
Adding guard to prevent PRs from merging that would otherwise be acceptable when they're marked with the "do-not-merge" label. Automatically runs whenever a label is removed in case the do-not-merge is removed (prompting immediate merge if conditions are acceptable).
Further, if a non-maintainer opens a PR against docs that's restricted only to a single SDK directory, a maintainer of that group can add their "automerge: " label to it and that'll suffice to trigger the bot and allow automerge. There are some variations made on this theme:
Issue reference