Repository navigation
ci: deploy.yml 部署 job 首步新增 Mask resource IDs 掩码步 (ONE-482) - #152
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-491(父单 ONE-482)
改动
只改
.github/workflows/deploy.yml一个文件:在deployjob 的steps:最前面(actions/checkout@v6之前)新增一个Mask resource IDs步,把三个资源 ID 注册为 Actions 日志掩码:D1_DATABASE_IDKV_NAMESPACE_IDCLOUDFLARE_ACCOUNT_ID细节(对齐冻结契约):
env:传入(${{ vars.* }}),run:脚本里不含任何表达式——脚本在步骤开始时会被原样回显,内联展开等于先漏一遍。[ -n "${!v}" ]守卫:值为空时跳过,不向空串注册掩码。D1_DATABASE_NAME(非敏感,掩了影响日志可读性)。背景
hop 是公开仓库,
wrangler d1 execute/wrangler deploy的输出会打印 D1 database ID、KV namespace ID 和账号 ID,现有 "Inject resource IDs" 步本身经 env 传值不回显,漏点只在工具输出,因此用::add-mask::覆盖。本 PR 不回溯清理旧 workflow run 的历史日志(不在本单范围)。
自测
YAML.load_file(ruby psych)解析通过;deployjob 共 16 steps,首步为Mask resource IDs,次步仍为actions/checkout@v6,其余 14 步名称与顺序不变。run:脚本本地执行三种用例:三者皆空 → 无输出;三者皆有值 → 输出三行::add-mask::<值>;仅一项有值 → 仅输出一行。bash -n通过;shellcheck(补 shebang 后)无告警。Test deploy scripts)。