-
Notifications
You must be signed in to change notification settings - Fork 30
ci: add release workflow #387
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||||||||||
| name: release | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| tags: | ||||||||||||||
| - "v*" | ||||||||||||||
|
|
||||||||||||||
| # Remove default permissions of GITHUB_TOKEN for security | ||||||||||||||
| # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | ||||||||||||||
| permissions: {} | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| release: | ||||||||||||||
| concurrency: | ||||||||||||||
| group: release | ||||||||||||||
| permissions: | ||||||||||||||
| contents: write | ||||||||||||||
| id-token: write | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| timeout-minutes: 20 | ||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||||||||||||||
| with: | ||||||||||||||
| fetch-depth: 0 | ||||||||||||||
| - run: corepack enable | ||||||||||||||
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | ||||||||||||||
| with: | ||||||||||||||
| node-version: latest | ||||||||||||||
|
|
||||||||||||||
| - name: π¦ Install dependencies | ||||||||||||||
| run: pnpm install | ||||||||||||||
|
|
||||||||||||||
| - name: Build (stub) | ||||||||||||||
| run: pnpm dev:prepare | ||||||||||||||
|
|
||||||||||||||
| - name: π Build project | ||||||||||||||
| run: pnpm build | ||||||||||||||
|
|
||||||||||||||
| - name: π¦ Release | ||||||||||||||
| run: pnpm publish --no-git-checks | ||||||||||||||
|
Comment on lines
+39
to
+40
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.
The publish step has no π§ Proposed fix: configure registry authFirst, add - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: latest
+ registry-url: "https://registry.npmjs.org"Then, add the token to the publish step: - name: π¦ Release
run: pnpm publish --no-git-checks
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||
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.
id-token: writegranted but--provenancenot used.The
id-token: writepermission is typically requested to enable npm provenance. If that's the intent,--provenanceneeds to be passed topnpm publish. If provenance is not intended, this permission should be removed to follow the principle of least privilege.π§ Option A: Enable provenance
π§ Option B: Remove unnecessary permission
permissions: contents: write - id-token: writeπ Committable suggestion
π€ Prompt for AI Agents