Skip to content

[feat] Add simple "labeled" merge-queue action#11

Draft
luongvo wants to merge 3 commits into
developfrom
feature/add-simple-merge-queue-action
Draft

[feat] Add simple "labeled" merge-queue action#11
luongvo wants to merge 3 commits into
developfrom
feature/add-simple-merge-queue-action

Conversation

@luongvo
Copy link
Copy Markdown
Member

@luongvo luongvo commented May 25, 2026

What happened 👀

Insight 📝

What it does

Label a PR with mergeme and merge-queue takes over:

  1. Rebases the PR onto the latest base branch
  2. Waits for all status checks to pass on the rebased code
  3. Squash merges into the base branch and deletes the source branch
  4. Dequeues with a PR comment explaining what went wrong if anything fails

Multiple PRs labeled at the same time? They all get processed. When a job starts, it scans for every open PR with the label and works through them in order — so even if several PRs are labeled while one is already being processed, they'll all be picked up by the time the queue drains.

How the queue works

When triggered, the action scans for all open PRs carrying the label and processes them serially — oldest first. The concurrency block ensures only one job runs at a time, so a second trigger that arrives while the first job is busy will wait and then drain whatever remains in the queue when it starts.

PR #1 labeled  ─┐
PR #2 labeled  ─┤──>  job picks up #1, #2, #3 in order  ──>  all merged
PR #3 labeled  ─┘

Each PR rebases onto the base branch at the moment it's processed, which includes all previously merged PRs. This is the key property of a merge queue — no PR merges without being tested against the current state of the target branch.

What happens on failure

merge-queue removes the mergeme label and leaves a comment on the PR explaining what went wrong:

Failure What merge-queue does
Merge conflicts Removes from queue, comments to resolve conflicts
Rebase fails Removes from queue, comments to rebase manually
Status checks fail Removes from queue, comments to fix and re-label
Timeout (default 30 min) Removes from queue, comments to re-label
Squash merge rejected Removes from queue, comments about branch protection

To retry, fix the issue and add the mergeme label again.

Proof Of Work 📹

TBA

@luongvo luongvo self-assigned this May 25, 2026
@luongvo luongvo force-pushed the feature/add-simple-merge-queue-action branch from 0fec1d1 to 58d7bb7 Compare May 25, 2026 09:15
@luongvo luongvo force-pushed the feature/add-simple-merge-queue-action branch from 58d7bb7 to 9dd710a Compare May 25, 2026 09:39
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