ECRET
cicd
secrets
ai_generated
true
Error: Secret MY_SECRET is not set or is empty
ID: cicd/gha-secret-not-found
92%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| any | active | — | — | — |
Root Cause
A GitHub Actions workflow references a secret that has not been configured in the repository or organization settings, or the secret is not available in the current context (e.g., fork pull requests).
genericWorkarounds
-
95% success Add the secret to the repository or organization settings
Go to Settings > Secrets and variables > Actions > New repository secret. Enter the exact name used in the workflow (e.g., MY_SECRET) and the value
-
88% success Use environment-level secrets and configure environment protection rules
Create an environment in Settings > Environments, add secrets there, and reference the environment in the workflow job with 'environment: production'
Dead Ends
Common approaches that don't work:
-
Hardcode the secret value directly in the workflow YAML
95% fail
Exposes credentials in version control; GitHub will redact known patterns but this is a severe security risk
-
Assume secrets from the base repo are available in fork PRs
99% fail
GitHub intentionally does not expose secrets to workflows triggered by pull_request events from forks to prevent secret exfiltration
Error Chain
Leads to:
Preceded by:
Frequently confused with: