Repository navigation
ci(deploy): mask Cloudflare resource IDs in Deploy logs (ONE-483 / ONE-487) - #155
Merged
Merged
Conversation
…-487 / ONE-483) 在 deploy job 中新增 Mask resource IDs 步(紧跟 checkout),把 D1_DATABASE_ID / KV_NAMESPACE_ID / CLOUDFLARE_ACCOUNT_ID 注册为 ::add-mask::,避免资源 ID 明文进入公开仓库的 GitHub Actions 日志。 - 值仅经 env: 传入,不内联进 run: 脚本 - 空值跳过([ -n ] 守卫),不注册空掩码 - 只掩这三个 ID,D1_DATABASE_NAME / TABLE_PREFIX 不掩 - 只改 .github/workflows/deploy.yml 一个文件,步骤顺序不变
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.
背景
eNotify 是公开仓库,Deploy 工作流日志会把 Cloudflare 资源 ID(账号 ID / D1 数据库 ID / KV namespace ID)明文打进 GitHub Actions 公开日志。本 PR 属于舰队五仓统一改动(父单 ONE-483),子单 ONE-487。
改动(只改一个文件)
.github/workflows/deploy.yml:在deployjob 内actions/checkout@v7之后、Patch wrangler.toml之前新增一步Mask resource IDs,把三项 ID 注册为::add-mask::。env:传入,run:中不内联${{ vars.* }}[ -n ]守卫),不注册空掩码D1_DATABASE_ID/KV_NAMESPACE_ID/CLOUDFLARE_ACCOUNT_ID;D1_DATABASE_NAME、TABLE_PREFIX不掩vars.*引用、其他步骤与顺序均未改动自检
.github/workflows/deploy.yml,+10 行)yaml@2parse,steps 顺序:checkout → Mask → setup-node … → Patch → Write secrets → Deploy)Patch wrangler.toml(#6) 与Deploy Worker(#8) ✅vars.*与 Patch 步一致D1_DATABASE_ID→vars.D1_DATABASE_ID、KV_NAMESPACE_ID→vars.KV_NAMESPACE_ID、CLOUDFLARE_ACCOUNT_ID→vars.CLOUDFLARE_ACCOUNT_ID逐字一致 ✅D1_DATABASE_NAME/TABLE_PREFIX::add-mask::;仅 D1 有值→1 行;三项全空→无输出 ✅CI 全绿后请 由 Mike 验收并按站立授权合并(合并即自动部署)。