Skip to content

Commit cb8bb2b

Browse files
meyfajasonsaaymanDigitalBrainJS
authored
chore(ci): Publish to NPM with provenance (#5835)
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/ Co-authored-by: Jay <[email protected]> Co-authored-by: Dmitriy Mozgovoy <[email protected]>
1 parent 37cbf92 commit cb8bb2b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
publish:
1212
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.head.label == 'axios:release')
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
1417
steps:
1518
- name: "Release PR info"
1619
if: github.event_name != 'workflow_dispatch'
@@ -22,7 +25,7 @@ jobs:
2225
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
2326
- uses: actions/setup-node@v3
2427
with:
25-
node-version: 16
28+
node-version: 18
2629
registry-url: https://registry.npmjs.org/
2730
- run: npm ci
2831
- name: get-npm-version
@@ -50,7 +53,7 @@ jobs:
5053
${{ steps.extract-release-notes.outputs.release_notes }}
5154
############# NPM RELEASE ##############
5255
- name: Publish the release to NPM
53-
run: npm publish
56+
run: npm publish --provenance --access public
5457
env:
5558
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5659
###### NOTIFY & TAG published PRs ######

0 commit comments

Comments
 (0)