Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This action will publish the package to npm and create a GitHub release.
name: Release

on:
# Run `npm run bump` to bump the version and create a git tag.
push:
Comment on lines +5 to +6
tags:
- "v*"

workflow_dispatch:

permissions:
contents: write
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
environment: npm
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24.14.0

- name: Setup Package Managers
run: |
npm install -g corepack@latest --force
corepack enable

- name: Install Dependencies
run: pnpm install

- name: Publish
uses: JS-DevTools/npm-publish@v4
with:
token: empty

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Provide a real npm token to the publish action

In the new release workflow, the publish step passes the literal string empty as the auth token, so tagged releases will try to publish to npm with invalid credentials and fail with an authentication error. Use a real secret-backed token (for example secrets.NPM_TOKEN) or the action’s documented trusted-publishing configuration instead of a hardcoded placeholder.

Useful? React with 👍 / 👎.


- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: "true"
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@
"scripts": {
"build": "rslib --syntax es2023 && pnpm run build:types",
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write",
"clean": "del-cli dist types",
"fix": "pnpm run fix:prettier",
"fix:prettier": "pnpm run lint:prettier -- --write",
"lint": "npm-run-all -l -p \"lint:**\"",
"lint:prettier": "prettier --cache --list-different .",
"lint:spelling": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
"lint:types": "tsc --pretty --noEmit",
"prepare": "pnpm run build",
"test": "rstest",
"test:watch": "rstest -w"
"test:watch": "rstest -w",
"bump": "npx bumpp"
},
Comment on lines 30 to 33
"devDependencies": {
"@fastify/express": "^4.0.2",
Expand All @@ -48,7 +46,6 @@
"connect": "^3.7.0",
"cspell": "^9.6.2",
"deepmerge": "^4.2.2",
"del-cli": "^6.0.0",
"execa": "^5.1.1",
"express": "^5.1.0",
"fastify": "^5.2.1",
Expand Down
Loading
Loading