Skip to content

Commit 82a3b4b

Browse files
committed
release: ensure npm publishing uses OIDC
Avoid setup-node's generated empty token configuration, which can suppress npm's trusted-publisher exchange. Pin a compatible npm CLI and support dispatching an existing tag so failed publications can be retried without rewriting tags. Normalize the repository URL to npm's canonical form for publisher validation.
1 parent c7d5c47 commit 82a3b4b

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: Existing release tag to publish
11+
required: true
12+
type: string
713

814
permissions:
915
contents: read
@@ -14,15 +20,19 @@ jobs:
1420
runs-on: ubuntu-latest
1521
steps:
1622
- uses: actions/checkout@v6
23+
with:
24+
ref: ${{ inputs.tag || github.ref }}
1725
- uses: actions/setup-node@v6
1826
with:
1927
node-version: "24"
20-
registry-url: https://registry.npmjs.org
2128
package-manager-cache: false
29+
- run: npm install --global npm@11.19.0
2230
- run: corepack enable
2331
- run: pnpm install --frozen-lockfile
2432
- name: Verify release tag
25-
run: node --eval "if ('v' + require('./package.json').version !== process.env.GITHUB_REF_NAME) process.exit(1)"
33+
env:
34+
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
35+
run: node --eval "if ('v' + require('./package.json').version !== process.env.RELEASE_TAG) process.exit(1)"
2636
- run: pnpm audit --audit-level high
2737
- run: pnpm check
2838
- run: npm publish --access public

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "module",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/sagemathinc/patchflow.git"
10+
"url": "git+https://github.com/sagemathinc/patchflow.git"
1111
},
1212
"bugs": {
1313
"url": "https://github.com/sagemathinc/patchflow/issues"

0 commit comments

Comments
 (0)