Repository navigation
fix: install-test default-branch probe on shallow checkout - #583
Conversation
`git remote set-head origin --auto` requires the target ref to already exist locally, but `actions/checkout@v6` only fetches the PR head ref — so the step errors with `Not a valid ref: refs/remotes/origin/main` on every install PR. Resolve the default branch via the GitHub API, fetch it shallowly, then point `origin/HEAD` at it. Closes #582 Co-Authored-By: Claude <[email protected]>
|
can we implement this by passing args to the checkout action? |
|
Not quite — The current API + shallow-fetch approach grabs only the one ref it needs and doesn't depend on |
## Summary - Bumps generator version to 0.1.0 and syncs lockfile. 7 commits since 0.0.25: - fix: jitter outage-issue dedup to handle concurrent matrix-leg failures (#586) - fix: install-test default-branch probe on shallow checkout (#583) - fix: pin install-tend badge link to max-sixty/tend (#585) - skills(review-reviewers): call out commenter-self-edit filters as a non-issue (#581) - triage: skip on tend-outage labeled issues (#579) - fix: use REST API for author_association in triage skill (#571) - skills(running-in-ci): catch already-merged sibling PRs in dedup (#569) ## Test plan - [x] `wt test` passes - [x] `pre-commit run --all-files` passes - [ ] CI green
Problem
The
tend-install-testworkflow's drift-check step fails on every install PR with:Root cause:
git remote set-head origin --autorequires the target ref (e.g.refs/remotes/origin/main) to already exist locally. With defaultactions/checkout@v6settings, only the PR head ref is fetched — so the command errors before any default-branch detection happens.Solution
Resolve the default branch via the GitHub API, fetch it shallowly, then point
origin/HEADat it. The generator's_detect_default_branch_local(git rev-parse --abbrev-ref origin/HEAD) then sees the correct value, so a repo with a non-maindefault doesn't report spurious drift.Testing
test_install_test_workflow_shapethat the workflow uses the API-based probe and notgit remote set-head(which would fail on shallow checkouts).test_install_test_workflow_regtestsnapshots for both Claude and Codex harnesses.origin/HEADcorrectly.pytestsuite passes (242 tests);pre-commitclean.Closes #582 — automated triage