GH_SECRET_MISSING cicd config_error ai_generated true

错误:秘密变量 AWS_ACCESS_KEY_ID 未设置或为空。

Error: Secret AWS_ACCESS_KEY_ID is not set or is empty

ID: cicd/github-actions-secret-not-found

其他格式: JSON · Markdown 中文 · English
90%修复率
88%置信度
1证据数
2023-09-01首次发现

版本兼容性

版本状态引入弃用备注
GitHub Actions active
GitHub Enterprise Server 3.8 active

根因分析

GitHub Actions 工作流引用了不存在或为空的仓库秘密变量,通常是因为未在仓库或组织级别创建该秘密,或者秘密名称拼写错误。

English

The GitHub Actions workflow references a repository secret that does not exist or is empty, often due to the secret not being created at the repo or org level, or a typo in the secret name.

generic

官方文档

https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions

解决方案

  1. Navigate to the repository settings, click 'Secrets and variables' > 'Actions', and add a new repository secret with the name AWS_ACCESS_KEY_ID and the correct value.
  2. If the secret is org-level, ensure the repository has access: go to org settings > 'Secrets and variables' > 'Actions' and add the repository to the secret's access list.

无效尝试

常见但无效的做法:

  1. 100% 失败

    Secrets are not dynamically generated; they must be created manually or via API before the workflow runs.

  2. 60% 失败

    Environment variables defined in YAML are visible in logs and not secure; GitHub requires secrets to be passed via `${{ secrets.SECRET_NAME }}` syntax.