Skip to content

Commit 23bb69d

Browse files
committed
Publish validated release artifacts
1 parent 6cc5f8e commit 23bb69d

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ jobs:
3838
fi
3939
4040
- name: Checkout main
41-
# Pinned immutable actions/checkout release SHA verified via git ls-remote.
41+
# Pinned immutable actions/checkout@v5 release SHA verified via git ls-remote.
4242
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
4343
with:
4444
ref: main
4545
fetch-depth: 1
4646

4747
- name: Use Node.js
48-
# Pinned immutable actions/setup-node release SHA verified via git ls-remote.
48+
# Pinned immutable actions/setup-node@v4 release SHA verified via git ls-remote.
4949
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
5050
with:
5151
# npm trusted publishing requires the npm CLI version shipped with the Node 24 line.
@@ -74,7 +74,6 @@ jobs:
7474
const path = require('node:path');
7575
7676
const inputVersion = process.env.INPUT_VERSION;
77-
const confirmPublish = process.env.CONFIRM_PUBLISH;
7877
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
7978
const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
8079
const header = changelog.match(/^## \[([0-9][^\]]*)\] - ([0-9]{4}-[0-9]{2}-[0-9]{2})$/m);
@@ -89,10 +88,6 @@ jobs:
8988
throw new Error(`CHANGELOG.md version "${changelogVersion}" is not valid semver (expected X.Y.Z or X.Y.Z-pre.N).`);
9089
}
9190
92-
if (confirmPublish !== 'publish') {
93-
throw new Error('confirm_publish must be exactly "publish".');
94-
}
95-
9691
if (inputVersion !== changelogVersion) {
9792
throw new Error(`workflow_dispatch version ${inputVersion} does not match CHANGELOG.md ${changelogVersion}.`);
9893
}
@@ -208,17 +203,17 @@ jobs:
208203
set -euo pipefail
209204
210205
# No npm auth token secret is configured; npm uses GitHub OIDC trusted publishing.
211-
# Keep the package prepublishOnly build as a publish-time artifact safety net.
212-
npm publish --provenance --tag "$NPM_TAG"
206+
# Publish the validated dist/ tree without rerunning prepublishOnly.
207+
npm publish --ignore-scripts --provenance --tag "$NPM_TAG"
213208
214209
- name: Create local release tag
215210
env:
216211
RELEASE_VERSION: ${{ steps.metadata.outputs.version }}
217212
run: |
218213
set -euo pipefail
219214
220-
git config user.name "github-actions[bot]"
221-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
215+
git config --local user.name "github-actions[bot]"
216+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
222217
git tag -a "$RELEASE_VERSION" -m "Release $RELEASE_VERSION" HEAD
223218
224219
- name: Push tag and create GitHub release

0 commit comments

Comments
 (0)