mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-08-08 11:38:42 +08:00
chore: 更新 publish.yml,移除不必要的註解並簡化 Node 環境設置
This commit is contained in:
@@ -8,20 +8,19 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
# 這是 Trusted Publishing 必須的權限
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4 # 建議升級至較新版本的 checkout
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v4 # 建議升級至較新版本的 setup-node
|
# 移除 registry-url,單純使用 setup-node 準備 Node 環境
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x' # 建議換成你目前使用的 Node LTS 版本
|
node-version: '20.x'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
|
||||||
# 使用 --provenance 進行發布,OIDC 自動完成驗證,不再需要 env.NODE_AUTH_TOKEN
|
# OIDC 和 provenance 會自動向官方 Registry 要權限
|
||||||
- run: npm publish --provenance
|
- run: npm publish --provenance
|
||||||
Reference in New Issue
Block a user