Repository navigation
fix(running-in-ci): base skill worktree on default branch, not HEAD - #401
Merged
Merged
Conversation
When this skill runs from tend-mention on an open PR, the workflow already did `gh pr checkout`, so `HEAD` is the PR branch — basing the skill worktree on it carries that PR's WIP commits into the skill PR. Surfaced by worktrunk PR #2656, which shipped 3 commits ahead of main (2 from the triggering fix/issue-2654 branch, 1 actual skill change). Switch to `origin/<default>` and explain the trap inline so a future reader doesn't simplify it back.
Merged
max-sixty
added a commit
that referenced
this pull request
May 13, 2026
Bumps generator to 0.0.18. ## Headline Expose the `__TEND_DELETE__` sentinel so TOML overrides can reach RFC 7396 delete-key semantics — useful for dropping a generator-injected key (e.g. `on.schedule` from a scheduled workflow) while keeping the rest. Closes #439, thanks @jrdncstr for reporting. ## Other changes since 0.0.17 - fix(action): sum usage and num_turns across all result entries (#437) - diag(action): upload execution-output.json (#408) - fix(mention): run setup before PR checkout so stale PRs don't drop mentions (#391) - fix(running-in-ci): base skill worktree on default branch (#401) - install-tend: fix oauth-token.sh returning an invalid token on macOS (#398) - oauth-token.sh: don't tee the OAuth token to stderr (#421) - Skill hardening: bang-escape guidance, review-reviewers corruption scans, dedup rules, $GITHUB_RUN_ID requirement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the
running-in-ci"How to propose" recipe so a skill PR opened from atend-mentionsession doesn't carry the triggering PR's WIP commits.Outcome that surfaced this
Run 25611071907 on
max-sixty/worktrunkwas atend-mentioninvoked on PR #2655. The agent followed the bundled "How to propose" recipe to draft a repo-local skill addition, and shipped worktrunk PR #2656 — titledskills(running-tend): don't restate mention-handler analysis in reviewsbut actually 5 files / 3 commits ahead ofmain:The first two commits are the open
fix/issue-2654branch backing PR #2655. They were dragged into the skill PR because the recipe'sgit worktree add … HEADruns after the workflow'sgh pr checkout, soHEADis the PR branch — not the default branch.Root cause
In
tend-mention(and any future skill that calls into the "How to propose" recipe from a PR-checkout context),gh pr checkout <n>lands first, leavingHEADat the PR's tip. The recipe then says:The new worktree starts from the PR's tip, so every commit on the PR is now part of the skill branch, and
gh pr createopens a PR with a base ofmainand the PR's commits in the diff.This is structural: the same conditions reproduce the failure every time a
tend-mentionrun on an open PR ends up proposing a skill change.Fix
Base the worktree on
origin/<default>instead ofHEAD.actions/checkout@v6already fetched the default branch (withfetch-depth: 0); agit fetch origin <default>keeps that ref current in case the workflow is long-running, thenorigin/<default>gives a clean base.Includes a one-paragraph "why not
HEAD" note inline so a future reader doesn't simplify it back.Scope
running-in-cirecipe (the one that runs fromtend-mention).HEADform inreview-runs/SKILL.mdandnightly/SKILL.mdalone — those run from scheduled workflows whereHEAD == origin/mainalready, so changing them would be churn unrelated to the bug fixed here.Gate assessment
tend-mention-→-skill-PR shape produces this outcome with the current recipe; no model-judgment variance.Evidence log: https://gist.github.com/9675d1510da32c68a68c1d45137b21e0
Test plan
hourly/review-…convention from the working tree the action checked out, so doesn't exercise the new recipe — but the new recipe is verified by readinggh repo view --json defaultBranchRef(returnsmainon this repo) and confirmingorigin/mainis fetched byactions/checkout@v6'sfetch-depth: 0.tend-mention-driven skill PR (worktrunk or any consumer), the skill PR's diff is exactly the skill change — no unrelated commits trailing in.