Skip to content

Preventing maintainer docs from automerging if marked with "do-not-merge" label#5111

Open
WhitWaldo wants to merge 5 commits into
dapr:v1.17from
WhitWaldo:bot-no-merge
Open

Preventing maintainer docs from automerging if marked with "do-not-merge" label#5111
WhitWaldo wants to merge 5 commits into
dapr:v1.17from
WhitWaldo:bot-no-merge

Conversation

@WhitWaldo
Copy link
Copy Markdown
Contributor

@WhitWaldo WhitWaldo commented Apr 12, 2026

Thank you for helping make the Dapr documentation better!

Please follow this checklist before submitting:

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Read the contribution guide
  • Commands include options for Linux, MacOS, and Windows within tabpane
  • New file and folder names are globally unique
  • Page references use shortcodes instead of markdown or URL links
  • Images use HTML style and have alternative text
  • Places where multiple code/command options are given have tabpane

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:

  • 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.

Issue reference

…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>
@WhitWaldo WhitWaldo self-assigned this Apr 12, 2026
@WhitWaldo WhitWaldo added the github_actions Pull requests that update GitHub Actions code label Apr 12, 2026
@WhitWaldo WhitWaldo requested review from a team as code owners April 12, 2026 18:49
WhitWaldo and others added 4 commits April 12, 2026 14:05
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_target triggers to include labeled/unlabeled events.
  • 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-merge label 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you check if this is relevant @WhitWaldo?

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you check if this is relevant @WhitWaldo? I think the likelyhood of this one is very small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants