Skip to content

Commit 2253a77

Browse files
authored
chore: Publish to NPM with provenance (#2276)
* chore: Publish to NPM with provenance The release process in this repository is already automated via GitHub Actions, which is a great first step toward creating trust in the supply chain. Recently, NPM has started to support publishing with the `--provenance` flag. This flag creates a link between the GitHub Actions run that created the release and the final artifact on NPM. This linkage further ensures that package installs can be traced back to a specific code revision. For more information on publishing with provenance, please refer to: https://github.blog/2023-04-19-introducing-npm-package-provenance/ * chore: Use Node.js 18 for publishing to support provenance
1 parent 5677f91 commit 2253a77

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ on:
55
jobs:
66
publish:
77
runs-on: ubuntu-20.04
8+
permissions:
9+
contents: read
10+
id-token: write
811
steps:
9-
- name: Setup Node.js 14
10-
uses: actions/setup-node@v2-beta
12+
- name: Setup Node.js 18
13+
uses: actions/setup-node@v3
1114
with:
12-
node-version: 14
15+
node-version: 18
1316
check-latest: true
1417
registry-url: https://registry.npmjs.org/
1518
- name: Checkout Repository
16-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
1720
- name: Install Dependencies
1821
run: npm install
1922
- name: Run Tests
2023
run: npm test
2124
- name: Publish Package to NPM Registry
22-
run: npm publish
25+
run: npm publish --provenance
2326
env:
2427
NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}}

0 commit comments

Comments
 (0)