Repository navigation
ONE-495: deploy 资源 ID 引用 vars→secrets,删除 add-mask 步 - #31
Merged
Merged
Conversation
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.
补正 ONE-485:deploy 日志里的资源 ID 明文问题改用 Secrets 解决,并删除上一 PR 加的
Mask resource IDs掩码步。背景
add-mask 方案有结构性残余:runner 会在执行某步之前先把该步的 env 区写进日志,而
::add-mask::要等前一步处理后才注册,因此携带该值的第一步 env 区必然明文(actions/runner#475)。改为三项资源 ID 全走 Secrets,由 GitHub 的 secret 掩码机制统一处理,掩码步不再需要。改动(仅
.github/workflows/deploy.yml)Mask resource IDs步骤(整步)。Patch wrangler.toml步 env 区:CLOUDFLARE_ACCOUNT_ID:vars.→secrets.D1_DATABASE_ID:vars.→secrets.KV_NAMESPACE_ID:vars.→secrets.D1_DATABASE_NAME(仍为组织级 Variable)、TABLE_PREFIX、Write secrets file、Deploy Worker及步骤顺序、注入方式(值仍只经env:传入,无${{ secrets.* }}内联进run:)。diff:+3 / -13,单文件。
全仓检索
vars.CLOUDFLARE_ACCOUNT_ID/vars.D1_DATABASE_ID/vars.KV_NAMESPACE_ID在.github/下已无残留;仓库其它位置(worker/wrangler.toml的*_PLACEHOLDER、README.md的部署文档)为占位符与文字说明,不含 vars 引用。合并前置(fail-closed)
合并前需三个 repository secret 已存在:
CLOUDFLARE_ACCOUNT_ID、D1_DATABASE_ID、KV_NAMESPACE_ID。缺失时该步 env 为空,Patch wrangler.toml会把占位符替换为空值、部署失败关闭。本 PR 不自行合并,等用户确认 Secrets 已建好。自测
pnpm typecheck/pnpm build/pnpm test本地全绿(web 19 files / 151 tests,worker 17 files / 156 tests)。***的验收由父单 ONE-485 关口统一核验。