Skip to content

Commit cdb3ab1

Browse files
authored
feat: publish package using NPM OIDC trusted publisher (#35)
1 parent a500da2 commit cdb3ab1

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+
18+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
19+
with:
20+
node-version: '24.x'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
# Ensure npm 11.5.1 or later is installed
24+
- name: Update npm
25+
run: npm install -g npm@latest
26+
- run: npm install --ignore-scripts
27+
- run: npm run build --if-present
28+
- run: npm test
29+
- run: npm publish

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
"coverage": "c8 -r html npm test",
1313
"lint": "eslint src test"
1414
},
15+
"publishConfig": {
16+
"registry": "https://registry.npmjs.org",
17+
"access": "public",
18+
"provenance": true
19+
},
1520
"repository": {
1621
"type": "git",
1722
"url": "git+https://github.com/dashlog/fetch-github-repositories.git"

0 commit comments

Comments
 (0)