Skip to content

fix(update): lease the template-update push against the fetched branch - #22

Merged
MattFisher merged 3 commits into
mainfrom
fix/template-update-push
Oct 7, 2026
Merged

MattFisher merged 3 commits into
mainfrom
fix/template-update-push

Conversation

@MattFisher

Copy link
Copy Markdown
Contributor

template-update.yml fails every week once its update branch exists. It pushes with a bare --force-with-lease to a URL rather than to origin, so git has no remote-tracking ref to lease against and refuses the push with stale info.

Both consumers are stuck on this. llm-prices and logfile-upload each had one run that pushed chore/template-update but couldn't open the PR (the Actions pull-request setting was off, see #21). Every run since has failed at the push, for example llm-prices run 37323803351:

! [rejected]        chore/template-update -> chore/template-update (stale info)

The fix leases against refs/remotes/origin/$BRANCH, which checkout's full fetch already populates. An empty value means the branch must not exist yet. python-project-template has the same step and gets the same fix in Generality-Labs/python-project-template#12.

Testing

I reproduced it against a local bare remote, with the remote-tracking refs fetched the way checkout fetches them:

  • Branch exists: the old command is rejected with stale info. The new one force-pushes.
  • Branch absent: the new one creates it.
  • Someone pushes to the branch after checkout: the new one is still refused. The lease still protects against that race.

actionlint and zizmor --offline --persona=auditor are clean on the file.

Both this PR and #21 add to [Unreleased], so whichever merges second needs a one-line rebase.

🤖 Generated with Claude Code

MattFisher and others added 3 commits October 7, 2026 18:21
A bare --force-with-lease to a URL has no remote-tracking ref to compare
against, so the push is refused with "stale info" whenever the update
branch already exists. Lease against the ref checkout fetched instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattFisher
MattFisher merged commit 9564c55 into main Oct 7, 2026
3 checks passed
@MattFisher
MattFisher deleted the fix/template-update-push branch October 7, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant