Attach manage.sh + checksum to a release created either way - #14
Merged
Conversation
The v0.4.0 release was written in the GitHub UI first and the tag pushed
after, so the workflow reached `gh release create` and stopped on "a
release with the same tag name already exists" - the three gates before
it had all passed. Nothing reached the release, which is why v0.4.0
carries no files.
That is the workflow's fault, not the order it was used in. It assumed
it authored the release; in practice the maintainer writes better notes
than a dump of the CHANGELOG section, and titles them ("v0.4.0
resilience") rather than taking the bare tag. So it now guards and
supplies rather than authors: if a release already exists it uploads
manage.sh and manage.sh.sha256 with --clobber and does not touch the
title or body; only when no release exists does it create one, using
that version's CHANGELOG section as a starting point.
manage.sh ships as an asset too, not just its checksum, giving a stable
per-version download URL for anyone pinning a release - and the checksum
now covers exactly the bytes published beside it (sha256sum on the
copied file, rather than hashing the repo path and relabelling it).
update-self keeps fetching the script from the tag ref rather than the
asset. The tag always resolves for any tag that exists, whereas an asset
can be missing - exactly what happened here - so the tag URL is the more
reliable of the two.
Both branches were exercised with a stub gh: with a release present it
makes one `upload --clobber` and zero `create` calls, three consecutive
runs stay idempotent, and `sha256sum -c` verifies the asset as it lands.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Answers the question directly: yes — with this change, a release you create in the GitHub UI gets both
manage.shandmanage.sh.sha256attached by the workflow, and your title and notes are left exactly as you wrote them.Why v0.4.0 got no files
You wrote the release in the UI at 14:01, then pushed the tag at 14:12. The workflow ran, passed the version gate, the shellcheck and the notes extraction, then died on the last step:
gh release createcannot create what exists. That is the workflow being wrong about how you work, not you using it wrongly — it assumed it would author the release, when in practice your notes are better than a dump of the CHANGELOG section and you title them ("v0.4.0 resilience") rather than taking the bare tag.What it does now
It guards and supplies instead of authoring:
gh release upload <tag> manage.sh manage.sh.sha256 --clobber, leaving title and body untouched;Either order works, and re-running is always safe. The two real gates — tag must match
VERSION, and the tagged script must pass shellcheck — are unchanged, becauseupdate-selfdownloads and runs exactly that file.manage.shnow ships as an asset too, so pinning a version has a stable URL, and the checksum covers exactly the bytes beside it.One deliberate non-change
update-selfstill fetches the script from the tag ref, not the asset. A tag always resolves; an asset can be missing — precisely what happened with v0.4.0. Switching to the asset would have turned that failure into a broken upgrade path instead of a cosmetic gap.Verified
Both branches driven with a stub
gh, asserting on the calls made:view→upload --clobberview→create … manage.sh manage.sh.sha256sha256sum -c manage.sh.sha256returnsmanage.sh: OKagainst the published asset. Workflow parses as YAML; everyrun:block passessh -n.For v0.4.0 as it stands
It has no assets, but nothing is broken: I confirmed the checksum URL 404s and
update-selfskips verification and installs normally. If you want to backfill it, the hash must come from the tagged commitfc05678:🤖 Generated with Claude Code