Fix Release workflow re-run failure; ignore .env - #2
Merged
Merged
Conversation
The first real release run failed, and the cause is worth recording because the symptom pointed somewhere else. The workflow checked out `github.sha` -- the commit that triggered the run -- rather than the branch tip. Attempt 1 committed the changelog and pushed main successfully, so main advanced. Attempts 2 and 3 then re-ran from that now stale sha, committed on top of it, and were correctly rejected as non-fast-forward. The visible error was "tip of your current branch is behind its remote counterpart", which reads like a race but was really the checkout pinning an old base. Two changes: - Check out `ref: main`. Combined with the changelog logic already being idempotent -- an empty [Unreleased] releases nothing -- a re-run is now a no-op rather than a guaranteed failure. - Guard each push separately, so a partially-completed attempt resumes. The previous version pushed the branch and the tag in one unguarded sequence, so a failure between them left a state where every retry failed on the first push and never reached the tag. That is exactly what happened: main carries the release commit, but v0.2.0 was never tagged and so nothing deployed. Also ignores .env. It is not currently tracked and never has been -- verified against the remote -- but the repository is public now, and an untracked .env sitting in the working tree is the classic accidental commit.
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.
Why
The first real release run failed. The symptom pointed somewhere other than the cause, so it is worth writing down.
release.ymlchecked outgithub.sha— the commit that triggered the run — instead of the branch tip. What actually happened on merge of #1:mainsuccessfully (b76e153), then did not reach the tagThe error read
tip of your current branch is behind its remote counterpart, which looks like a race between jobs. It was not — the checkout had pinned an old base, so every retry was guaranteed to fail.Current state on
main: version is0.2.0and the changelog is correctly rolled over, butv0.2.0was never tagged, so nothing deployed. The live site is still running the pre-ID-generator build.Changes
ref: mainon checkout. Combined with the changelog logic already being idempotent — an empty[Unreleased]releases nothing — a re-run is now a no-op instead of a guaranteed failure..envis gitignored. It is not tracked and never has been — I verified it returns 404 on the public remote — but the repo is public now and an untracked.envin the working tree is the classic accidental commit.Merging this cuts v0.2.1
Dry run confirms:
[Unreleased]has only### Fixed→ patch →0.2.0→0.2.1. That tag will deploy, which also ships the ID generator, collapsible sidebar, GitHub link and focus-ring fix that are sitting onmainundeployed.Recovering v0.2.0
v0.2.0has release notes onmainbut no tag. Either:git tag -a v0.2.0 <sha> && git push origin v0.2.0— which deploys that commit and validatesdeploy.ymlend to end before the next merge depends on it; orv0.2.1carry everything.v0.2.0then simply never exists as a tag.I have not done either — it is a production deploy, so it is your call.
Verification
release.ymlparses;pnpm exec vite-node scripts/release.ts --dry-runreportspatch → v0.2.1.git check-ignore -v .envconfirms the ignore rule matches.