Skip to content

Commit e895760

Browse files
authored
Merge pull request #102 from SocketDev/release-provenance
npm provenance GH action
2 parents 8c7e276 + d6fb938 commit e895760

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/provenance.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: '18'
20+
registry-url: 'https://registry.npmjs.org'
21+
cache: npm
22+
- run: npm install -g npm@latest
23+
- run: npm install
24+
- run: npm publish --provenance --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Publishing a new version
2+
3+
This repository uses `npm` provided provenance using GitHub Actions, please update the version in `package.json` using an appropriate tag and create a release using GitHub, the `.github/workflows/provenance.yml` action should publish it to `npm` from there.

0 commit comments

Comments
 (0)