From 80a6f6cf04c1dcd07db22fd8f72dc4e9ae2ea5c6 Mon Sep 17 00:00:00 2001 From: martyy-code Date: Mon, 3 Aug 2026 13:59:05 +0200 Subject: [PATCH] fix(release): use git diff --cached to detect staged changes in release 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. --- .changeset/fix-release-version-commit.md | 5 +++++ .github/workflows/release.yml | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-release-version-commit.md diff --git a/.changeset/fix-release-version-commit.md b/.changeset/fix-release-version-commit.md new file mode 100644 index 0000000..2f6cbe1 --- /dev/null +++ b/.changeset/fix-release-version-commit.md @@ -0,0 +1,5 @@ +--- +"@deessejs/errors": patch +--- + +Fix a bug in the release workflow: `git diff --quiet` (without `--cached`) compared the working tree to the index, which is in sync immediately after `git add -A`. This caused the version bump commit to be skipped, leaving the working tree in a `pnpm changeset publish`-able state but never pushed to `main`. Use `git diff --cached --quiet` so the comparison is against the last commit (HEAD), which is what we actually want. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ebd652..1d052dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,10 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add -A - git diff --quiet || git commit -m "chore(release): version packages" + # Use --cached: after `git add -A`, the diff against the index is empty. + # `git diff --quiet` (without --cached) compares the working tree to the + # index, which is already in sync, so the commit was never created. + git diff --cached --quiet || git commit -m "chore(release): version packages" git push origin HEAD git push --tags