Skip to content

Commit 877804c

Browse files
committed
ci: simplify pnpm version resolution for the sticky disk key
Read the packageManager pin with jq instead of a node -p invocation and a case statement. The resolved version only feeds the node_modules sticky disk cache key; the pnpm that actually runs self-resolves to the pinned version via manage-package-manager-versions regardless of which binary starts it.
1 parent 7ebed1a commit 877804c

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

  • .github/actions/setup-linux-blacksmith-sticky-disk

‎.github/actions/setup-linux-blacksmith-sticky-disk/action.yaml‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ runs:
1717
id: pnpm
1818
if: steps.blacksmith.outputs.enabled == 'true'
1919
shell: bash
20-
run: |
21-
package_manager="$(node -p "require('./package.json').packageManager ?? ''")"
22-
case "$package_manager" in
23-
pnpm@*) echo "version=${package_manager#pnpm@}" >> "$GITHUB_OUTPUT" ;;
24-
*) echo "version=unknown" >> "$GITHUB_OUTPUT" ;;
25-
esac
20+
run: echo "version=$(jq -r '.packageManager | ltrimstr("pnpm@")' package.json)" >> "$GITHUB_OUTPUT"
2621

2722
- name: Prepare Nix store mount point
2823
if: steps.blacksmith.outputs.enabled == 'true'

0 commit comments

Comments
 (0)