From c7d49f73f76c613632b7471444f6fffcc9888c31 Mon Sep 17 00:00:00 2001 From: Fabian Meyer <3982806+meyfa@users.noreply.github.com> Date: Sat, 26 Aug 2023 15:13:59 +0200 Subject: [PATCH 1/2] 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/ --- .github/workflows/npm-publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b4b62f1b9..e1568a482 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -5,6 +5,9 @@ on: jobs: publish: runs-on: ubuntu-20.04 + permissions: + contents: read + id-token: write steps: - name: Setup Node.js 14 uses: actions/setup-node@v2-beta @@ -19,6 +22,6 @@ jobs: - name: Run Tests run: npm test - name: Publish Package to NPM Registry - run: npm publish + run: npm publish --provenance env: NODE_AUTH_TOKEN: ${{secrets.NPM_SECRET}} From 25123165fd52a1aa76b68ccbabe8cf5af5504f77 Mon Sep 17 00:00:00 2001 From: Fabian Meyer <3982806+meyfa@users.noreply.github.com> Date: Sat, 26 Aug 2023 16:13:32 +0200 Subject: [PATCH 2/2] chore: Use Node.js 18 for publishing to support provenance --- .github/workflows/npm-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index e1568a482..ccc202ca2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,14 +9,14 @@ jobs: contents: read id-token: write steps: - - name: Setup Node.js 14 - uses: actions/setup-node@v2-beta + - name: Setup Node.js 18 + uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 check-latest: true registry-url: https://registry.npmjs.org/ - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Dependencies run: npm install - name: Run Tests