Skip to content

Commit 709b12b

Browse files
committed
Improve package manager security
- Don't run install scripts automatically - Set minimumReleaseAge
1 parent cbf4b8d commit 709b12b

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ on:
77
branches: [main]
88

99
env:
10-
# Installing Chrome is not required for linting files.
11-
PUPPETEER_SKIP_DOWNLOAD: true
1210
# Output colored text
1311
FORCE_COLOR: 1
1412

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ jobs:
4141
run:
4242
echo 0 | sudo tee
4343
/proc/sys/kernel/apparmor_restrict_unprivileged_userns
44+
- name: Install Chrome
45+
run: pnpm install-chrome-for-puppeteer
4446
- name: Run tests
4547
run: pnpm test

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"format": "prettier --write .",
3939
"lint": "tsc && eslint && prettier --check .",
4040
"test": "node --test --test-reporter spec test/test.js",
41-
"test:update-snapshots": "node --test --test-reporter spec --test-update-snapshots test/test.js"
41+
"test:update-snapshots": "node --test --test-reporter spec --test-update-snapshots test/test.js",
42+
"install-chrome-for-puppeteer": "puppeteer browsers install chrome"
4243
},
4344
"dependencies": {
4445
"chokidar": "^4.0.3",

pnpm-workspace.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
onlyBuiltDependencies:
2-
- puppeteer
1+
# Reduce risk of installing compromised packages by only installing packages
2+
# that are at least a day old.
3+
minimumReleaseAge: 1440

0 commit comments

Comments
 (0)