Skip to content

Commit 397d0d7

Browse files
ci: move to oidc based trusted publishing with npm (#1026)
* ci: move to oidc based trusted publishing with npm NPM now strongly recommends the use of https://docs.npmjs.com/trusted-publishers instead of tokens. Hence this migrates to that. See also changesets/action#542 related to this for further information on changesets specific setup required. Signed-off-by: MTRNord <[email protected]> * ci: use corect packages permissions Signed-off-by: MTRNord <[email protected]> * ci: ensure we have the correct permissions set for changesets Signed-off-by: MTRNord <[email protected]> * ci: Remove unused "Generate GitHub token" step Signed-off-by: MTRNord <[email protected]> --------- Signed-off-by: MTRNord <[email protected]> Signed-off-by: MTRNord
1 parent 47e61de commit 397d0d7

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ jobs:
1313
timeout-minutes: 15
1414
outputs:
1515
example-widget-mui-image-tag: ${{ steps.meta_example-widget-mui.outputs.version }}
16+
permissions:
17+
# Used for trusted publishing to npm via OIDC
18+
id-token: write
19+
# Used for changesets action
20+
pull-requests: write
21+
issues: write
22+
contents: write
23+
# Used for pushing container images
24+
packages: write
1625
steps:
1726
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1827
with:
@@ -88,22 +97,15 @@ jobs:
8897
labels: ${{ steps.meta_example-widget-mui.outputs.labels }}
8998
platforms: linux/amd64,linux/arm64,linux/s390x
9099

91-
- name: Generate GitHub token
92-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
93-
id: generate_token
94-
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # @v2.1.0
95-
with:
96-
app_id: ${{ secrets.GH_APP_OS_APP_ID }}
97-
private_key: ${{ secrets.GH_APP_OS_PRIVATE_KEY }}
98-
99100
- name: Create Release Pull Request or Publish Packages
100101
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
101102
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10
102103
with:
103104
publish: yarn release
104105
env:
105-
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
106-
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
# Use OIDC for npm authentication instead of NPM_TOKEN
108+
NPM_TOKEN: '' # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
107109
helm-lint-test:
108110
runs-on: ubuntu-latest
109111
needs: build

0 commit comments

Comments
 (0)