Skip to content

fix(release): use git diff --cached in version bump step - #45

Merged
codewizdave merged 1 commit into
mainfrom
release/release-system-stack
Aug 3, 2026
Merged

fix(release): use git diff --cached in version bump step#45
codewizdave merged 1 commit into
mainfrom
release/release-system-stack

Conversation

@martyy-code

Copy link
Copy Markdown
Contributor

Summary

Fixes the release workflow's version bump step. The previous git diff --quiet (without --cached) compared the working tree to the index, which is in sync immediately after git add -A. So no commit was ever created. The publish step ran anyway because pnpm changeset version had locally modified files, but git push origin HEAD had nothing to push.

Symptom observed during PR #44 release

@deessejs/errors ran through pnpm changeset version (consuming all 7 changesets to bump 1.1.1 → 1.2.0 locally), but the version bump commit was never created and pushed. The release workflow then attempted pnpm changeset publish, which failed with ENEEDAUTH (trusted publishing was pointed at the wrong environment — now fixed on npmjs.com).

What this PR changes

release.yml: git diff --quiet || git commit -m ...git diff --cached --quiet || git commit -m .... The commit now compares against HEAD instead of the index, which is what we want after git add -A.

What this PR triggers on merge

The release workflow runs again. Pending changesets in the diff:

  • fix-release-version-commit.md (this commit's changeset, patch)

If the OIDC trusted publisher is now correctly configured on npmjs.com, @deessejs/errors@1.2.1 will be published. (The previous 1.2.0 bump that never made it is now lost — that's fine, the new version supersedes it.)

Affected file

  • .github/workflows/release.yml
  • .changeset/fix-release-version-commit.md

🤖 Generated with Claude Code

…se workflow

The 'Commit version changes and push' step used 'git diff --quiet',
which compares the working tree to the index. After 'git add -A', the
working tree and index are in sync, so diff --quiet exits 0 and the
commit never happens. The version bump ran locally but was not pushed,
and the publish step attempted to publish 1.2.0 without committing it.

Use 'git diff --cached --quiet' to compare against HEAD instead. The
commit will now be created on a real diff.

This also surfaces a second symptom: if 'pnpm changeset version'
modifies files, they will be staged for commit, but the tag will also
need to be pushed. The current script does both 'git push origin HEAD'
and 'git push --tags', which covers it once the commit is actually made.

Adds a changeset to pass the new ci.yml lint.
@codewizdave
codewizdave merged commit 96047f2 into main Aug 3, 2026
4 checks passed
martyy-code added a commit that referenced this pull request Aug 3, 2026
…ags)

PR #45 fixed the missing version-bump commit but ENEEDAUTH persisted
on the publish step. Trust on npmjs.com was tightened (no environment
filter), but the workflow was still not signaling OIDC intent to pnpm.

Three aligned changes, mirroring the proven pattern in our other
release workflows:

1. Release workflow: node-version 22 -> 24. The runner already defaults
   to Node 24; pinning 22 was unnecessarily old and predates the npm
   CLI >= 11.5.1 + Node >= 22.14.0 trusted-publishing prerequisites.
2. 'Publish packages' step: add env NPM_CONFIG_PROVENANCE: 'true'.
   pnpm reads this and routes publish through OIDC, not the legacy
   fallback path that requires a token.
3. packages/errors/package.json: add publishConfig.provenance: true.
   Belt + suspenders alongside the env var, and gives npm a default
   intent for provenance attestation on every publish.

Adds a changeset to pass the new ci.yml lint.
martyy-code added a commit that referenced this pull request Aug 3, 2026
…ags)

PR #45 fixed the missing version-bump commit but ENEEDAUTH persisted
on the publish step. Trust on npmjs.com was tightened (no environment
filter), but the workflow was still not signaling OIDC intent to pnpm.

Three aligned changes, mirroring the proven pattern in our other
release workflows:

1. Release workflow: node-version 22 -> 24. The runner already defaults
   to Node 24; pinning 22 was unnecessarily old and predates the npm
   CLI >= 11.5.1 + Node >= 22.14.0 trusted-publishing prerequisites.
2. 'Publish packages' step: add env NPM_CONFIG_PROVENANCE: 'true'.
   pnpm reads this and routes publish through OIDC, not the legacy
   fallback path that requires a token.
3. packages/errors/package.json: add publishConfig.provenance: true.
   Belt + suspenders alongside the env var, and gives npm a default
   intent for provenance attestation on every publish.

Adds a changeset to pass the new ci.yml lint.
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.

2 participants