Skip to content

ci: make owner auto-merge opt-in via automerge label - #446

Merged
tomymaritano merged 1 commit into
developfrom
fix/automerge-opt-in-label
Jul 3, 2026
Merged

ci: make owner auto-merge opt-in via automerge label#446
tomymaritano merged 1 commit into
developfrom
fix/automerge-opt-in-label

Conversation

@tomymaritano

@tomymaritano tomymaritano commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Auto-merge workflow enabled auto-merge on every owner PR on opened/synchronize/reopened/ready_for_review. Consequences:

  • PRs to develop had auto-merge enabled automatically, so they merged the moment branch protection was satisfied — before CodeRabbit review was resolved (the exact CodeRabbit-first violation we keep hitting).
  • Stacked PRs targeting an unprotected feature branch merged instantly (no protection to hold them). This is what collapsed the stacked UI PR (feat(planning): Planning Kanban board UI + graph toggle #445) into its base branch before review.

Fix

Owner auto-merge is now opt-in via the automerge label:

  • The automerge-owner job only runs when the PR carries the automerge label, and the workflow now also reacts to the labeled event.
  • Add the label when a PR is genuinely ready to merge; leave it off (or remove it) to hold — no more surprise merges.
  • Dependabot auto-merge is unchanged.

The automerge label has been created in the repo.

Testing

Workflow-only change (YAML). Verified the if: uses contains(github.event.pull_request.labels.*.name, 'automerge') and the labeled trigger is present so applying the label enables auto-merge.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated automated merge behavior to require both a matching PR author and an automation label before merging.
    • Expanded event handling so labeled pull requests are evaluated for auto-merge eligibility.

Auto-merge was enabled on every owner PR on open/synchronize/ready, so
PRs merged the moment branch protection was satisfied — before review was
resolved — and stacked PRs targeting an unprotected feature branch merged
instantly (this collapsed a stacked UI PR into its base). Now the owner
job only enables auto-merge when the PR carries the `automerge` label
(and reacts to the `labeled` event), so merging is an explicit opt-in.
Dependabot auto-merge is unchanged.

Requires an `automerge` label in the repo (create with
`gh label create automerge`).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f53c207c-b75f-4419-a33d-115be148c99a

📥 Commits

Reviewing files that changed from the base of the PR and between 6781e71 and d4849bf.

📒 Files selected for processing (1)
  • .github/workflows/automerge.yml

📝 Walkthrough

Walkthrough

The automerge GitHub Actions workflow's pull_request trigger now includes the labeled event type. The automerge-owner job's condition is changed to require both the author login match and the presence of an automerge label, instead of author match alone. Inline comments were updated accordingly.

Changes

Automerge Workflow Update

Layer / File(s) Summary
Trigger and owner gating condition
.github/workflows/automerge.yml
Adds labeled to pull_request trigger event types and updates the automerge-owner job condition to require both author login match and the automerge label, with comments updated to match.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested labels

ci, github-actions

Suggested reviewers

tomymaritano

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: owner auto-merge now requires the automerge label.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/automerge-opt-in-label

Comment @coderabbitai help to get the list of available commands.

@tomymaritano
tomymaritano merged commit efa55d4 into develop Jul 3, 2026
16 of 17 checks passed
@tomymaritano
tomymaritano deleted the fix/automerge-opt-in-label branch July 3, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant