-
Notifications
You must be signed in to change notification settings - Fork 2
chore: add OIDC authentication for npm in release workflow #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,9 @@ on: | |||||||
| branches: | ||||||||
| - main | ||||||||
|
|
||||||||
| concurrency: ${{ github.workflow}}-${{github.ref}} | ||||||||
| permissions: | ||||||||
| id-token: write # Required for OIDC | ||||||||
| contents: read | ||||||||
|
|
||||||||
| jobs: | ||||||||
| release: | ||||||||
|
|
@@ -18,32 +20,23 @@ jobs: | |||||||
| # This makes action fetch all Git history so that Changesets can generate changelogs with the correct commits | ||||||||
| fetch-depth: 0 | ||||||||
|
|
||||||||
| - name: Enable Corepack | ||||||||
| run: corepack enable | ||||||||
|
|
||||||||
| - name: Use Node.js 20.x | ||||||||
| - name: Setup Node.js | ||||||||
| uses: actions/setup-node@v4 | ||||||||
| with: | ||||||||
| node-version: 20.x | ||||||||
| cache: 'npm' | ||||||||
| env: | ||||||||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||
| node-version-file: '.nvmrc' | ||||||||
| registry-url: 'https://registry.npmjs.org' | ||||||||
|
|
||||||||
| - name: Install Dependencies | ||||||||
| run: npm ci --ignore-scripts | ||||||||
| env: | ||||||||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||
|
|
||||||||
| - name: Build the release | ||||||||
| run: npm run build | ||||||||
| env: | ||||||||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||||||
|
|
||||||||
| - name: Create Release Pull Request or Publish to npm | ||||||||
| uses: changesets/action@v1 | ||||||||
| with: | ||||||||
| version: npm run changeset version | ||||||||
| publish: npm run release | ||||||||
| commit: 'chore: version packages' | ||||||||
| env: | ||||||||
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | ||||||||
|
||||||||
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
Comment on lines
-1
to
-2
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| npx --no -- commitlint --edit ${1} | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 20.13.0 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dev: upgrade to what is soon to be the latest LTS |
||
| 24 | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev: per our offline discussion with @causaly-mark this is not needed anymore