Skip to content

ci: add a merge guard check for the do-not-merge label - #523

Merged
caitlon merged 3 commits into
devfrom
ci/merge-guard-workflow
Oct 3, 2026
Merged

caitlon merged 3 commits into
devfrom
ci/merge-guard-workflow

Conversation

@caitlon

@caitlon caitlon commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Problem

A pull request that must not merge yet has no visible marker beyond a comment, and the do-not-merge label does nothing on its own.

Change

A Merge guard check fails while the do-not-merge label is on. .github/workflows/merge-guard.yml runs on pull requests into dev, test and prod, on opened, reopened, synchronize, labeled and unlabeled. It reads the label list from the event payload through env and jq, 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.yml would 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.md lists it. The same edit corrects the sentence above it: dev requires Check already.

Verification

  • uvx --from actionlint-py actionlint .github/workflows/merge-guard.yml: clean. The run: body executed on six label payloads: do-not-merge present exits 1, other labels and [] exit 0, null, invalid JSON and empty input exit non-zero with an annotation.
  • Backend half of the push gate (ruff, bandit, mypy, detect-secrets, unit and integration tests): 3266 passed.
  • Not checked: a live run on GitHub. Merge guard becomes a required check on dev after this merges, and the label blocks a merge from then on.

Migrations

None.

Screenshots

None.

@caitlon caitlon added this to the backlog milestone Oct 3, 2026
@caitlon caitlon added type:tech-debt Code quality improvement type:docs Documentation area:infra CI/CD, Docker labels Oct 3, 2026
@caitlon caitlon self-assigned this Oct 3, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository.

@github-actions github-actions Bot added the size:S Under 300 changed lines. label Oct 3, 2026
@caitlon caitlon added do-not-merge Must not be merged yet. The Merge guard check fails while this label is on. and removed do-not-merge Must not be merged yet. The Merge guard check fails while this label is on. labels Oct 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

@caitlon
caitlon merged commit 1220f46 into dev Oct 3, 2026
21 of 25 checks passed
@caitlon
caitlon deleted the ci/merge-guard-workflow branch October 3, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:infra CI/CD, Docker size:S Under 300 changed lines. type:docs Documentation type:tech-debt Code quality improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant