WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions ci/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
release:
types: [created]

permissions:
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,7 +32,10 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- run: npm ci
# It is recommend to publish to npm using trusted publishing; for details,
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

Corrected grammar from 'It is recommend' to 'It is recommended'.

Suggested change
# It is recommend to publish to npm using trusted publishing; for details,
# It is recommended to publish to npm using trusted publishing; for details,

Copilot uses AI. Check for mistakes.
# see: https://docs.npmjs.com/trusted-publishers
- run: npm publish
Copy link
Contributor

@hashtagchris hashtagchris Oct 9, 2025

Choose a reason for hiding this comment

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

We may want to leave the token commented out, as a fallback for GHES, and GHEC w/ data residency.

Suggested change
- run: npm publish
- run: npm publish
env:
# An explicit token is needed only for non-github.com workflows.
# NODE_AUTH_TOKEN: ${{secrets.npm_token}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think a bare env: will cause an error, but I pushed up a riff on this suggestion.

env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Loading