Skip to content

Commit dcc9fed

Browse files
Add trusted publishing for npm package (#329)
1 parent 354a137 commit dcc9fed

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010

11+
permissions:
12+
id-token: write
13+
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v6
@@ -39,11 +42,7 @@ jobs:
3942
- name: Publish npm package
4043
if: ${{ !github.event.release.prerelease }}
4144
run: npm publish --tag latest
42-
env:
43-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4445

4546
- name: Publish npm package (pre-release)
4647
if: ${{ github.event.release.prerelease }}
4748
run: npm publish --tag beta
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ Releases run in CI using github actions.
6262

6363
To prepare a release create a new release TAG in github with your release version.
6464

65-
> `NPM_TOKEN` should be stored in the repositories [secrets in GitHub](https://github.com/NHSDigital/nhsuk-react-components/settings/secrets/actions)
66-
6765
- Create a new release with a tag like `major.minor.patch` against main.
6866
- If the change is a `beta` then select `pre-release` as true, this will make the `tag` point at `beta`. Otherwise the tag will be `latest`.
6967

0 commit comments

Comments
 (0)