Skip to content

Commit ef148d5

Browse files
committed
Fix pnpm dependency workflow cache and lockfile updates
`pnpm audit --fix` only writes overrides to package.json / pnpm-workspace.yaml without refreshing pnpm-lock.yaml, so the PR produced for security fixes had a stale lockfile. The post step for actions/setup-node also failed with "Path Validation Error" because the pnpm store was never populated. Add a `pnpm install --no-frozen-lockfile` step after the audit / update operation so the lockfile is refreshed and the pnpm store exists for the cache post-step.
1 parent fba6d0a commit ef148d5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/pnpm_dependency_update_and_create_pr.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ jobs:
6262
if: ${{ inputs.operation == 'audit-fix' }}
6363
run: pnpm audit --fix
6464

65+
# `pnpm audit --fix` only writes overrides to package.json /
66+
# pnpm-workspace.yaml; it does not refresh pnpm-lock.yaml. Running
67+
# `pnpm install` here both applies the overrides to the lockfile and
68+
# populates the pnpm store so the `cache: pnpm` post-step in
69+
# actions/setup-node has a path to cache (otherwise it fails with
70+
# "Path Validation Error: Path(s) specified in the action for caching
71+
# do(es) not exist").
72+
- name: Install dependencies to update lockfile and populate cache
73+
run: pnpm install --no-frozen-lockfile
74+
6575
- name: Create Pull Request
6676
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 #v8
6777
with:

0 commit comments

Comments
 (0)