fix(ci): don't silently skip publishes when change detection fails#108
Merged
Conversation
publish-all-packages.yml computed changed packages with `pnpm turbo ... 2>/dev/null ... || echo "[]"`. Any turbo failure or an unreachable `github.event.before` (shallow clone, force-push, freshly created branch) collapsed to `[]` -> has-changes=false -> the entire version-and-publish job was skipped, silently dropping the release. This is how @saga-ed/soa-postgres 0.1.2 failed to publish on the #107 merge despite a green workflow run. Distinguish a real diff failure from a genuinely-empty diff: surface turbo's stderr, guard that the base ref is reachable, and on any uncertainty fall back to ALL packages. The publish step is idempotent (npm publish skips already-published versions), so a superset is safe; an empty set is not.
❌ Test Results
Package Results
Commits
LinksUpdated: 2026-06-01T22:40:02.003Z |
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.
Problem
publish-all-packages.yml's change-detection computed the changed-package set with:CHANGED_PACKAGES=$(pnpm turbo run build --dry=json --filter="...[${BASE_REF}]" 2>/dev/null | jq ... || echo "[]")Any turbo failure — or an unreachable
github.event.before(shallow clone, force-push, freshly created branch) — collapses to[]. That setshas-changes=false, which gatescalculate-dependency-layersand the entireversion-and-publishjob, so the whole release is silently skipped while the workflow still reports ✅.2>/dev/nullhides the turbo error that would have explained it.This just bit us:
@saga-ed/soa-postgres@0.1.2did not publish on the #107 merge — the run was green butdetect-changesloggedChanged packages: []and the publish job was skipped. (0.1.2 was then published manually.)Fix
Distinguish a real diff failure from a genuinely-empty diff:
git cat-file -e) before diffing.[].A superset is safe because the publish step is already idempotent —
npm publishskips versions that already exist (continue on error … may already exist). So at worst we re-attempt publishing unchanged packages (no-op); we never silently drop a real release again.Verification
yaml.safe_loadparses ✅;bash -non the extracted script ✅.[]; new logic → the full 29-package fallback (incl.node/postgres), i.e. publish would proceed.Note: the bug fixed here is in the workflow on
main; this PR doesn't change any package, so it won't itself trigger a publish.