From 58015fe45bb7e3f70a7260526b310593fa004aed Mon Sep 17 00:00:00 2001 From: myw Date: Thu, 11 Jun 2026 00:47:39 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20publish.yml?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E8=A8=BB=E8=A7=A3=E4=B8=A6=E7=B0=A1=E5=8C=96=20Node=20?= =?UTF-8?q?=E7=92=B0=E5=A2=83=E8=A8=AD=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9c4d17c..8581634 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,20 +8,19 @@ jobs: build: runs-on: ubuntu-latest - # 這是 Trusted Publishing 必須的權限 permissions: contents: read id-token: write 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: - node-version: '20.x' # 建議換成你目前使用的 Node LTS 版本 - registry-url: 'https://registry.npmjs.org' + node-version: '20.x' - run: npm install - # 使用 --provenance 進行發布,OIDC 自動完成驗證,不再需要 env.NODE_AUTH_TOKEN + # OIDC 和 provenance 會自動向官方 Registry 要權限 - run: npm publish --provenance \ No newline at end of file