GitHub Actions "Context access might be invalid" (actionlint)
By Kaveh Alemi·Latchkey
actionlint cannot statically confirm that a referenced secret, input, or step output exists, so it flags the access as possibly invalid.
What this error means
actionlint reports "Context access might be invalid: <name>" for a ${{ }} reference, often a secret or a needs output.
github-actions
ci.yml:12:18: context access might be invalid: secrets.DEPLOY_KEY [expression]
Common causes
A secret not known to actionlint
actionlint cannot see repository or org secrets, so it warns on any secrets.X it has not been told about.
An output or input that does not exist
Referencing steps.x.outputs.y where step x never set y is a real bug this warning surfaces.
How to fix it
Confirm the reference or configure actionlint
- Verify the secret, input, or output actually exists and is spelled correctly.
- Provide actionlint a config listing known secrets to silence false positives.
.github/actionlint.yaml
# .github/actionlint.yaml
self-hosted-runner:
labels: []
How to prevent it
- Set step outputs before referencing them downstream.
- Keep an actionlint config with known secret names for the repo.
Frequently asked questions
What causes ""Context access might be invalid""?
actionlint cannot see repository or org secrets, so it warns on any secrets.X it has not been told about.
How do I fix "Context access might be invalid"?
Confirm the reference or configure actionlint
Related guides
References