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

- **ID:** `cicd/github-actions-secret-not-found`
- **领域:** cicd
- **类别:** config_error
- **错误码:** `GH_SECRET_MISSING`
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| GitHub Actions | active | — | — |
| GitHub Enterprise Server 3.8 | active | — | — |

## 解决方案

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.
   ```

## 无效尝试

- **** — Secrets are not dynamically generated; they must be created manually or via API before the workflow runs. (100% 失败率)
- **** — Environment variables defined in YAML are visible in logs and not secure; GitHub requires secrets to be passed via `${{ secrets.SECRET_NAME }}` syntax. (60% 失败率)
