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