Skip to content

Commit 5617843

Browse files
Merge pull request #181 from step-security/auto-cherry-pick
chore: Cherry-picked changes from upstream
2 parents 0a28469 + 95370b7 commit 5617843

13 files changed

Lines changed: 668 additions & 40 deletions

File tree

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ If `run_install` is a YAML string representation of either an object or an array
3838

3939
**Optional** (_type:_ `string[]`) Additional arguments after `pnpm [recursive] install`, e.g. `[--ignore-scripts, --strict-peer-dependencies]`.
4040

41+
### `cache`
42+
43+
**Optional** (_type:_ `boolean`, _default:_ `false`) Whether to cache the pnpm store directory.
44+
45+
### `cache_dependency_path`
46+
47+
**Optional** (_type:_ `string|string[]`, _default:_ `pnpm-lock.yaml`) File path to the pnpm lockfile, which contents hash will be used as a cache key.
48+
4149
### `package_json_file`
4250

4351
**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json`/[`package.yaml`](https://github.com/pnpm/pnpm/pull/1799) to read "packageManager" configuration.
@@ -113,7 +121,7 @@ jobs:
113121
- uses: step-security/action-setup@v4
114122
with:
115123
version: 10
116-
run_install:
124+
run_install: |
117125
- recursive: true
118126
args: [--strict-peer-dependencies]
119127
- args: [--global, gulp, prettier, typescript]
@@ -138,13 +146,7 @@ jobs:
138146
name: Install pnpm
139147
with:
140148
version: 10
141-
run_install: false
142-
143-
- name: Install Node.js
144-
uses: actions/setup-node@v4
145-
with:
146-
node-version: 20
147-
cache: 'pnpm'
149+
cache: true
148150
149151
- name: Install dependencies
150152
run: pnpm install

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ inputs:
1515
description: If specified, run `pnpm install`
1616
required: false
1717
default: 'null'
18+
cache:
19+
description: Whether to cache the pnpm store directory
20+
required: false
21+
default: 'false'
22+
cache_dependency_path:
23+
description: File path to the pnpm lockfile, which contents hash will be used as a cache key
24+
required: false
25+
default: 'pnpm-lock.yaml'
1826
package_json_file:
19-
description: File path to the package.json to read "packageManager" configuration
27+
description: File path to the package.json to read "packageManager" configuration. This path must be relative to the repository root (GITHUB_WORKSPACE).
2028
required: false
2129
default: 'package.json'
2230
standalone:

dist/index.js

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
"update-pnpm-dist": "pnpm install && cp ./node_modules/pnpm/dist/pnpm.cjs ./dist/pnpm.cjs && cp ./node_modules/pnpm/dist/worker.js ./dist/worker.js"
88
},
99
"dependencies": {
10+
"@actions/cache": "^4.1.0",
1011
"@actions/core": "^1.11.1",
12+
"@actions/exec": "^1.1.1",
13+
"@actions/glob": "^0.5.0",
1114
"@types/expand-tilde": "^2.0.2",
1215
"@types/node": "^20.11.5",
13-
"@types/node-fetch": "^2.6.13",
1416
"axios": "^1.12.0",
1517
"expand-tilde": "^2.0.2",
1618
"yaml": "^2.3.4",
1719
"zod": "^3.22.4"
1820
},
1921
"devDependencies": {
20-
"@vercel/ncc": "^0.38.1",
22+
"@vercel/ncc": "^0.38.4",
2123
"pnpm": "^10.28.2",
2224
"typescript": "^5.3.3"
2325
}

0 commit comments

Comments
 (0)