Skip to content

Commit 7bdc112

Browse files
ci: regenerate yarn.lock as part of the changesets version-bump step (#52)
* ci: regenerate yarn.lock as part of the changesets version-bump step yarn changeset version only rewrites package.json/CHANGELOG.md, never re-runs install. When it bumps a dependent's peerDependency range (e.g. common-cse-machine >=0.1.0 -> >=0.2.0 in runner/web-cse-machine), that leaves yarn.lock stale, which then fails the resulting "Version Packages" PR's immutable install in CI (exactly what happened on #51). Chain a plain "yarn install" after "yarn changeset version" so the lockfile is always in sync in the same bot commit. It's a no-op when nothing needs to change. * ci: set YARN_ENABLE_IMMUTABLE_INSTALLS=false for the version-bump install Matches changesets/action's own documented recommendation for the "run yarn install after changeset version" pattern (see its README's Yarn section) — without it this install could itself run in an immutable/frozen mode and fail instead of doing its job.
1 parent 0fb0056 commit 7bdc112

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/on_push.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,19 @@ jobs:
3333
uses: changesets/action@v1
3434
with:
3535
publish: yarn changeset publish
36-
version: yarn changeset version
36+
# changeset version only rewrites package.json/CHANGELOG.md — it never re-runs
37+
# install, so a peerDependency range bump (e.g. common-cse-machine >=0.1.0 -> >=0.2.0
38+
# in a dependent's package.json) can leave yarn.lock stale. That stale lockfile then
39+
# fails CI's immutable install on the resulting "Version Packages" PR. Re-running
40+
# install here keeps the lockfile in sync in the same commit; it's a no-op when
41+
# nothing changed.
42+
version: yarn changeset version && yarn install
3743
env:
3844
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
# changesets/action's own README recommends this for the yarn-install-after-version
46+
# pattern: without it, this install could itself run in an immutable/frozen mode and
47+
# fail instead of regenerating the lockfile.
48+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
3949
- name: Upload artifacts
4050
id: deployment
4151
uses: actions/upload-pages-artifact@v5

0 commit comments

Comments
 (0)