Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit ce825d0

Browse files
gantoineclaude
andauthored
chore(skills): let merging-prs enqueue before approval (#3880)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 46fdc26 commit ce825d0

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.claude/skills/merging-prs/SKILL.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To merge, you enqueue the PR with a comment, then watch it until Trunk lands it.
1212

1313
When a developer says "merge this PR", "merge it when it's ready", "land it",
1414
"ship it", or "babysit this PR", do the full loop below — enqueue **and** watch
15-
to completion, reporting the outcome. See also [docs/merge-queue.md](../../../docs/merge-queue.md).
15+
to completion, reporting the outcome.
1616

1717
`<n>` below is the PR number. Resolve the repo slug once if you need it:
1818
`REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)`.
@@ -29,8 +29,21 @@ gh pr view <n> --json state,isDraft,mergeable,reviewDecision,statusCheckRollup
2929
- **Failing required checks** (`statusCheckRollup`) → the queue will just reject
3030
it. Report which checks are red and stop; fix them first. **Pending** checks
3131
are fine — the queue waits for them.
32+
- **Not yet approved** (`reviewDecision` empty or `REVIEW_REQUIRED`) → fine,
33+
enqueue anyway. See below.
3234
- **Merge conflicts** (`mergeable == "CONFLICTING"`) → report and stop; rebase first.
3335

36+
Enqueueing before approval is safe, and is the closest thing this repo has to
37+
auto-merge. A submitted PR sits in Trunk's `Queued` state until GitHub's branch
38+
protection on `main` is satisfied — one approving review, code-owner review, and
39+
the required checks (`build`, `quality`, `unit-test`, `integration-test`,
40+
`typecheck`) — and Trunk merges it once they land. Trunk is not a bypass actor on
41+
those rules, so it cannot merge an unapproved or red PR.
42+
43+
The catch: **pushing new commits drops the PR from the queue.** If review
44+
feedback is likely, either wait for approval before enqueueing, or re-enqueue
45+
with `/trunk merge` after each push.
46+
3447
## 2. Enqueue
3548

3649
```bash
@@ -68,7 +81,10 @@ sleep 60
6881
- Watch the **check run + PR state**, not `gh pr checks --watch`: the queue runs
6982
CI on Trunk's own draft/`trunk-merge/**` branch, so this PR's own checks don't
7083
reflect the queue's testing.
71-
- Stop at the timeout with a status summary rather than looping forever.
84+
- If it's parked in `Queued` waiting on a human review, say so once and slow the
85+
cadence to ~5 minutes. Keep watching — the merge still has to be reported.
86+
- Stop at the timeout with a status summary rather than looping forever. If it
87+
was still waiting on review, say that's why and offer to keep watching.
7288

7389
## 4. Handle failure
7490

0 commit comments

Comments
 (0)