From 004b1c46be4d09b6d166a1fa00684cabe64de38f Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Tue, 3 Oct 2023 23:26:54 -0400 Subject: [PATCH] Add `--provenance` to `npm publish` command (#18) See the following links on this new supply chain security feature that GitHub and npm offer. - https://github.blog/2023-04-19-introducing-npm-package-provenance/ - https://docs.npmjs.com/generating-provenance-statements --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1c5f17b..db17c92 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,9 @@ jobs: uses: ./.github/workflows/ci.yml publish-to-npm: name: Publish to npm + permissions: + contents: read + id-token: write needs: ci runs-on: ubuntu-latest steps: @@ -21,7 +24,7 @@ jobs: registry-url: https://registry.npmjs.org - run: npm ci - run: npm run build - - run: npm publish + - run: npm publish --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-to-github-packages: