mirror of
https://github.com/jnMetaCode/superpowers-zh.git
synced 2026-09-03 07:23:56 +08:00
harden(ci): deploy-site workflow 的 action 全部 SHA 固定(供应链加固)
部署 job 持有可写的 Cloudflare API token,第三方 action 用可变标签 (@v3 等)存在标签劫持/供应链风险。改为 commit SHA 固定,附版本注释: - actions/checkout@34e1148… # v4 - actions/setup-node@49933ea… # v4 - cloudflare/wrangler-action@9acf94a… # v3 SHA 与 GitHub 当前标签解析一致(checkout/setup-node 的 SHA 也与既往 CI 日志中运行器解析的值吻合)。YAML 已校验合法。
This commit is contained in:
7
.github/workflows/deploy-site.yml
vendored
7
.github/workflows/deploy-site.yml
vendored
@@ -18,14 +18,15 @@ jobs:
|
||||
contents: read
|
||||
deployments: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
# Action 全部 SHA 固定(防供应链/标签劫持,因本 job 持有可写的 Cloudflare token)
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Build site
|
||||
run: node site/build.mjs
|
||||
- name: Deploy to Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
|
||||
Reference in New Issue
Block a user