Repository navigation
ci(deploy): 资源 ID 改走 Secrets 并移除 add-mask 步 (ONE-483 / ONE-487) - #156
Merged
Merged
Conversation
add-mask 存在结构性残余:runner 在执行某步前会先回显该步 env 区,此时 掩码尚未注册,携带值的第一步 env 区必然明文(actions/runner#475)。 改为直接引用 Secrets,值不再进入 env 头明文: - CLOUDFLARE_ACCOUNT_ID / D1_DATABASE_ID / KV_NAMESPACE_ID: vars. → secrets. - 删除 Mask resource IDs 掩码步(已无存在意义) 不动 D1_DATABASE_NAME(仍 vars.、明文)与 TABLE_PREFIX(仍 vars.); 其余步骤、顺序与文件均未改动。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
本单原实现(PR #155,已合并上线)是给 Deploy 工作流加
::add-mask::掩码步。用户复查部署日志后拍板:add-mask 有结构性残余 —— runner 在执行某步前会先回显该步env区,此时掩码尚未注册,携带值的第一步 ev 区必然明文(GitHub 已知时序问题 actions/runner#475)。因此补正为资源 ID 全走 Secrets,并删除已无意义的掩码步。属于舰队五仓统一改动(父单 ONE-483)。改动(只改一个文件)
.github/workflows/deploy.yml(+3 / -13):Patch wrangler.toml步 env 中三处引用vars.→secrets.:CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID }}KV_NAMESPACE_ID: ${{ secrets.KV_NAMESPACE_ID }}Mask resource IDs掩码步(整个 step 移除)。不动:
D1_DATABASE_NAME(仍组织级 Variable、明文)、TABLE_PREFIX(仍vars.);其余步骤、顺序与其他文件一律未改。自检
.github/workflows/deploy.yml)Mask resource IDs步grep -rn 'add-mask'全仓无命中secrets.引用Patch步 env 三行逐字符合契约D1_DATABASE_NAME/TABLE_PREFIXvars.,未迁移(deploy.yml 中剩余vars.仅这两行)yaml@2parse 通过${{ secrets.X }}引用语法)grep 结果
合并关口(重要)
不要合并。 Secrets 只能由用户本人在 GitHub 设置页创建,三个 Secret 未建好前合并即会让 Deploy 中断(引用为空 → 注入步失败关闭)。需先确认
CLOUDFLARE_ACCOUNT_ID/D1_DATABASE_ID/KV_NAMESPACE_ID三个 Repository Secret 已在仓库设置中建好,用户放行后再合并部署。本地自测:lint / format:check / typecheck / build / test 全通过(213 tests,17 files)。