Skip to content

Commit 16ed405

Browse files
committed
fix(Release): Migrate to OIDC connect
1 parent f3dfbd8 commit 16ed405

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ jobs:
1111
release:
1212
name: Release
1313
runs-on: ubuntu-latest
14+
# https://docs.npmjs.com/trusted-publishers#github-actions-configuration
1415
permissions:
15-
contents: write
16-
issues: write
17-
pull-requests: write
18-
packages: write
16+
id-token: write # Required for npm OIDC
17+
contents: write # Required for semantic-release to create releases/tags
18+
issues: write # Required for semantic-release to comment on issues
19+
pull-requests: write # Required for semantic-release to comment on PRs
1920

2021
steps:
2122
- name: Checkout
@@ -29,6 +30,7 @@ jobs:
2930
with:
3031
node-version: 'lts/*'
3132
cache: 'npm'
33+
registry-url: https://registry.npmjs.org
3234

3335
- name: Install dependencies
3436
run: npm ci
@@ -40,7 +42,7 @@ jobs:
4042
run: npm run build
4143

4244
- name: Semantic Release
43-
run: npm run semantic-release
45+
# Use npx to ensure npm OIDC token is passed correctly
46+
run: npx semantic-release --no-ci
4447
env:
4548
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
46-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
}
9999
]
100100
},
101+
"publishConfig": {
102+
"access": "public",
103+
"provenance": true
104+
},
101105
"license": "MIT",
102106
"dependencies": {
103107
"@ideal-postcodes/core-interface": "~3.2.1",

0 commit comments

Comments
 (0)