Skip to content

Fix Release workflow re-run failure; ignore .env - #2

Merged
fadeltd merged 1 commit into
mainfrom
fix/release-checkout-and-env
Sep 24, 2026
Merged

fadeltd merged 1 commit into
mainfrom
fix/release-checkout-and-env

Conversation

@fadeltd

@fadeltd fadeltd commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Why

The first real release run failed. The symptom pointed somewhere other than the cause, so it is worth writing down.

release.yml checked out github.sha — the commit that triggered the run — instead of the branch tip. What actually happened on merge of #1:

Attempt What it did
1 Committed the changelog, pushed main successfully (b76e153), then did not reach the tag
2, 3 Re-ran from the now-stale trigger sha, committed on top of it, push rejected as non-fast-forward

The 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 is 0.2.0 and the changelog is correctly rolled over, but v0.2.0 was never tagged, so nothing deployed. The live site is still running the pre-ID-generator build.

Changes

  • ref: main on 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.
  • Each push is guarded separately. The old version pushed the branch and the tag in one unguarded sequence, so a failure between them left a state where every retry died on the first push and never reached the tag. Now a partially-completed attempt resumes.
  • .env is 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 .env in 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 on main undeployed.

Recovering v0.2.0

v0.2.0 has release notes on main but no tag. Either:

  • push the tag by hand — git tag -a v0.2.0 <sha> && git push origin v0.2.0 — which deploys that commit and validates deploy.yml end to end before the next merge depends on it; or
  • skip it and let this PR's v0.2.1 carry everything. v0.2.0 then simply never exists as a tag.

I have not done either — it is a production deploy, so it is your call.

Verification

  • 330 tests pass; typecheck, lint and build clean.
  • release.yml parses; pnpm exec vite-node scripts/release.ts --dry-run reports patch → v0.2.1.
  • git check-ignore -v .env confirms the ignore rule matches.

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.
@fadeltd
fadeltd merged commit e027e85 into main Sep 24, 2026
1 check passed
@fadeltd
fadeltd deleted the fix/release-checkout-and-env branch September 24, 2026 08: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