Skip to content

Commit 1952400

Browse files
authored
more secure npm publish
1 parent 2cd8a03 commit 1952400

File tree

10 files changed

+14756
-14958
lines changed

10 files changed

+14756
-14958
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: ci
22
on: push
33

4+
permissions:
5+
id-token: write
6+
contents: read
7+
packages: write
8+
49
jobs:
510
build-and-upload-artifacts:
611
runs-on: ubuntu-latest
@@ -17,10 +22,10 @@ jobs:
1722
runs-on: ubuntu-latest
1823
steps:
1924
- uses: actions/checkout@v2
20-
- name: Use Node.js 14.x
21-
uses: actions/setup-node@v1
25+
- name: Use Node.js 22.x
26+
uses: actions/setup-node@v6
2227
with:
23-
node-version: 14.x
28+
node-version: 22.x
2429
- run: yarn pnpify depcheck
2530

2631
run-pre-commits:
@@ -30,11 +35,11 @@ jobs:
3035
with:
3136
fetch-depth: 100 # need the history to do a changed files check below (source, origin)
3237
- uses: actions/setup-python@v2
33-
- name: Use Node.js 14.x
34-
uses: actions/setup-node@v1
38+
- name: Use Node.js 22.x
39+
uses: actions/setup-node@v6
3540
with:
36-
node-version: 14.x
37-
- uses: pre-commit/action@v2.0.2
41+
node-version: 22.x
42+
- uses: pre-commit/action@v3.0.0
3843
with:
3944
extra_args: --source ${{ github.event.pull_request.base.sha || 'HEAD~1' }} --origin ${{ github.event.pull_request.head.sha || 'HEAD' }}
4045

@@ -50,13 +55,13 @@ jobs:
5055
uses: actions/checkout@v2
5156
- uses: actions/setup-node@v2
5257
with:
53-
node-version: '14.x'
58+
node-version: '22.x'
5459
- name: Configure NPM authentication
5560
run: |
5661
yarn config set npmAlwaysAuth true
5762
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
5863
- name: Publish to yarn/npm
59-
run: yarn npm publish
64+
run: yarn npm publish --provenance
6065

6166
build-to-github-packages:
6267
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)