Skip to content

Commit 29729f8

Browse files
authored
ci: CI to pick pnpm version automatically from package.json's packageManager field (#3)
1 parent 3e713c4 commit 29729f8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/actions/ci-common-setup/action.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ runs:
1818
- name: Get Node.js version
1919
id: node_version
2020
run: |
21-
echo "::set-output name=version::$(node -v)"
21+
echo "version=$(node -v)" >>$GITHUB_OUTPUT
2222
shell: bash
2323

24+
- name: Get package manager type and version from `package.json`
25+
id: pkg_manager_value
26+
uses: ActionsTools/read-json-action@main
27+
with:
28+
file_path: './package.json'
29+
prop_path: 'packageManager'
30+
2431
- name: Install pnpm
25-
run: npm install -g pnpm@^9
32+
run: npm install -g ${{ steps.pkg_manager_value.outputs.value }}
2633
shell: bash
2734

2835
- name: Restore possibly cached dependencies

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"author": "Dor Shtaif <dorshtaif@gmail.com>",
55
"license": "MIT",
66
"description": "The magic of JavaScript async iterators in React ⛓️ 🧬 🔃",
7-
"type": "module",
7+
"keywords": [],
88
"homepage": "https://github.com/shtaif/react-async-iterators",
99
"bugs": "https://github.com/shtaif/react-async-iterators/issues",
1010
"repository": "github:shtaif/react-async-iterators",
11+
"type": "module",
12+
"packageManager": "pnpm@9.15.0",
1113
"sideEffects": false,
12-
"keywords": [],
1314
"main": "./dist/cjs/index.js",
1415
"module": "./dist/esm/index.js",
1516
"types": "./dist/esm/index.d.ts",

0 commit comments

Comments
 (0)