fix(ci): run refresh-assets before package diff check in publish-patch#8276
Merged
MitjaBezensek merged 1 commit intomainfrom Mar 25, 2026
Merged
fix(ci): run refresh-assets before package diff check in publish-patch#8276MitjaBezensek merged 1 commit intomainfrom
MitjaBezensek merged 1 commit intomainfrom
Conversation
This prevents releasing a new patch version when doing a simple docs hotfix.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
mimecuvalo
approved these changes
Mar 24, 2026
Member
mimecuvalo
left a comment
There was a problem hiding this comment.
i think this is good to go
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.
In order to stop docs-only hotfixes from triggering unwanted npm patch releases, this PR adds
yarn refresh-assets --forcebefore thegetAnyPackageDiff()check inpublish-patch.ts.Root cause
PR #8204 added
.yarn/install-state.gzto the CI cache. When Yarn determines that the install state hasn't changed (e.g.node_modulesis already populated and no dependencies changed), it skips lifecycle scripts includingpostinstall(related discussion). This means thepostinstallhook (husky install && yarn refresh-assets) never runs.Without
refresh-assets, the gitignored asset directories in@tldraw/assets(embed-icons/,fonts/,icons/,translations/) don't exist on disk. ThegetAnyPackageDiff()guard runsyarn packwhich produces a tarball missing these dirs (14 files), while the npm-published tarball has them (265 files) — always finding a diff, always publishing.Before #8204 (working): PR #8102 docs hotfix cherry-picked to v4.4.x — publish-patch skipped correctly, no version bump.
After #8204 (broken): PRs #8263 and #8270 docs hotfixes cherry-picked to v4.5.x — both triggered unwanted npm publishes (v4.5.1 and v4.5.2).
Why this approach
Considered three options:
install-state.gzfrom cache — doesn't actually help; Yarn skips postinstall based on dependency changes, not just the state filerefresh-assetsto the setup action — overkill; lazyrepo already auto-runs it as a dependency ofbuild,build-types, anddevrefresh-assetstopublish-patch.ts— targeted fix matching whattrigger-sdk-hotfix.tsalready does (line 98)Option 3 is the right call.
publish-patch.tsis the only workflow confirmed broken — everything else is protected by either lazyrepo's dependency graph or explicitrefresh-assetscalls in the workflow YAML.Change type
bugfixTest plan
Verified locally:
yarn packon@tldraw/assets→ 14 filesyarn refresh-assets --forceyarn packagain → 265 filesOn a release branch with only docs changes,
getAnyPackageDiff()should now returnnull→ "No packages have changed, skipping release" → no publish.Code changes