Skip to content

Commit 515c58d

Browse files
Improve npm installation security
1 parent 3339d4b commit 515c58d

5 files changed

Lines changed: 36 additions & 11 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
16+
- uses: actions/setup-node@v6
17+
with:
18+
node-version: '24.x'
19+
cache: npm
20+
- run: npm install -g npm@11 --registry=https://registry.npmjs.org
1621
- name: Setup Pages
1722
uses: actions/configure-pages@v5
1823
- run: npm ci
1924
- name: Build docs
2025
run: npm run docs
2126
- name: Upload artifact
22-
uses: actions/upload-pages-artifact@v3
27+
uses: actions/upload-pages-artifact@v5
2328
with:
2429
path: ./docs/build
2530

@@ -36,4 +41,4 @@ jobs:
3641
steps:
3742
- name: Deploy to GitHub Pages
3843
id: deployment
39-
uses: actions/deploy-pages@v4
44+
uses: actions/deploy-pages@v5

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ jobs:
1212
contents: read
1313
packages: write
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v7
16+
- uses: actions/setup-node@v6
1717
with:
18-
node-version: '20.x'
18+
node-version: '24.x'
1919
registry-url: 'https://registry.npmjs.org'
2020
cache: npm
21-
- uses: microbit-foundation/npm-package-versioner-action@v1
21+
- run: npm install -g npm@11 --registry=https://registry.npmjs.org
22+
- uses: microbit-foundation/npm-package-versioner-action@v3
2223
- run: npm ci
2324
env:
2425
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.npmrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
11
access=public
2+
3+
min-release-age=7
4+
min-release-age-exclude[]=@microbit/*
5+
min-release-age-exclude[]=@microbit-foundation/*
6+
7+
# root here means this project's package.json
8+
allow-git=root
9+
allow-remote=root
10+
allow-file=root
11+
allow-directory=root
12+
13+
strict-allow-scripts=true
14+
15+
engine-strict=true

package-lock.json

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

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111
"type": "git",
1212
"url": "https://github.com/microbit-foundation/python-editor-embed"
1313
},
14+
"allowScripts": {
15+
"fsevents": true,
16+
"esbuild": true
17+
},
18+
"packageManager": "npm@11.18.0",
1419
"engines": {
15-
"node": ">=20",
16-
"npm": ">=10"
20+
"node": ">=24.0.0",
21+
"npm": ">=11.18.0"
1722
},
1823
"main": "./dist/cjs/index.js",
1924
"module": "./dist/esm/index.js",

0 commit comments

Comments
 (0)