fix: remove workflow-level env block exposing AK/SK secrets in deploy-cdn.yml#23
Draft
fix: remove workflow-level env block exposing AK/SK secrets in deploy-cdn.yml#23
Conversation
…-cdn.yml Agent-Logs-Url: https://github.com/hexqi/tiny-engine/sessions/3df4833b-3a72-4060-a7e5-683f8f0213a9 Co-authored-by: hexqi <18585869+hexqi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove environment variables to mitigate security risk
fix: remove workflow-level env block exposing AK/SK secrets in deploy-cdn.yml
Apr 1, 2026
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.
English | 简体中文
PR
PR Checklist
请检查您的 PR 是否满足以下要求:
PR 类型
这个PR的类型是?
需求背景和解决方案
deploy-cdn.yml的顶层env:块将华为云 AK/SK、Endpoint、Bucket 等敏感密钥提升为工作流级别的进程环境变量,使其暴露给所有 job 和 step,存在泄露风险。变更内容:
env:块,消除四个 secret 的全局环境变量映射:deploy-cdnjob 中所有${{ env.HUAWEI_CLOUD_* }}引用,改为直接引用${{ secrets.HUAWEI_CLOUD_* }},仅在obsutil config和上传命令处按需展开,不写入进程环境。check-secretsjob 原本已直接使用secrets.*,无需改动。修改前
AK/SK 作为工作流环境变量存在于所有 job 的进程环境中,任意 step(包括第三方 action)均可读取。
修改后
AK/SK 仅在
deploy-cdnjob 的单一 step 中按需展开,GitHub Actions 自动 mask,不写入环境,缩小了泄露面。此PR是否含有 breaking change?
Other information
N/A