fix(ci): restore all tracked files before goreleaser - #741
Merged
Conversation
The v2.1.2 release failed at "git is in a dirty state", before goreleaser created anything, so the image and publish_chart jobs were skipped and nothing reached Docker Hub. Reproducing the release steps on a clean clone shows `npm i` rewriting frontend/package-lock.json: the committed lockfile carries `libc` fields that the runner's npm strips. The cleanup step restored only frontend/yarn.lock, so the rewritten package-lock.json stayed dirty. Restore every tracked file instead of naming one. `git clean -fd` also drops untracked directories, which `-f` alone leaves behind. No `-x`, so the ignored pkg/frontend/dist survives for the Go build to embed. The underlying mismatch remains: this workflow pins no node-version, so the runner's npm can differ from whichever npm wrote the lockfile. Co-Authored-By: Claude Opus 5 (1M context) <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.
The
v2.1.2release run failed atgit is in a dirty state(run). goreleaser aborts duringgetting and validating git state, so no GitHub release was created and theimage/publish_chartjobs were skipped — nothing reached Docker Hub. The tag has since been deleted; this will go out as v2.1.3.Root cause
Replaying the release steps on a clean clone of the tagged commit —
npm i→npm run build→git clean -f && git checkout frontend/yarn.lock— leaves exactly one dirty path:npm istripslibcfields from the committed lockfile (48 deletions), because the runner's npm is older than whichever npm wrote it. The cleanup step restored onlyfrontend/yarn.lock, whichnpm ialso rewrites, so nobody was restoringpackage-lock.json.This is not a regression from either recent PR — the release path has been broken since some frontend dependency bump landed after v2.1.1 in March.
Change
Restores every tracked file rather than naming one, and
-ddrops untracked directories that plain-fleaves behind.No
-x, deliberately: the builtpkg/frontend/distis ignored via/pkg/frontend/dist/*and the Go binary embeds it. I verified in a scratch repo thatgit clean -fdleaves a directory whose contents are all ignored intact — with-xit would be deleted and the build would fail on thego:embed.Not fixed here
This workflow pins no
node-version, so the runner's npm can keep drifting from whichever npm writes the lockfile. Pinning it would stop the rewrite at the source rather than cleaning up after it. Separately, thereleasejob checks out shallow — onlypre_releasesetsfetch-depth: 0— which is why goreleaser warnedcouldn't find any tags before "v2.1.2"and will produce an empty changelog.🤖 Generated with Claude Code