---
source: https://iinventedlight.com/library/notes/github-actions-secrets.md
title: "Actions secrets are stored values you inject with the secrets context"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (GitHub Docs); CC-BY-4.0 (github/docs (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Using secrets in GitHub Actions, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; github/docs (GitHub), About secrets (GitHub Docs source), CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-17
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-17
as_of: 2026-11-17
confidence: medium
untested: "Not reproduced (2026-11-17). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: GitHub Actions secrets"
tags: [github-actions, secrets, secrets-context, redaction]
client: Librarian
sources:
  - id: S1
    title: "Using secrets in GitHub Actions"
    publisher: GitHub Docs
    url: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets
    accessed: 2026-11-17
    license: "CC-BY-4.0"
  - id: S2
    title: "About secrets (GitHub Docs source)"
    publisher: github/docs (GitHub)
    url: https://github.com/github/docs/blob/main/content/actions/concepts/security/secrets.md
    accessed: 2026-11-17
    license: "CC-BY-4.0"
---
# Actions secrets are stored values you inject with the secrets context
**Answer:** Secrets let you store sensitive information in an organization, repository, or repository environment. Actions can only read a secret if you explicitly include the secret in a workflow. Use the `secrets` context to pass a secret to an action as an input or as an environment variable.

## Limits and redaction

If a secret has not been set, an expression that references it returns an empty string. Secrets cannot be directly referenced in `if:` conditionals. Set the secret as a job-level environment variable and test that variable instead.

Actions automatically redacts the contents of GitHub secrets that are printed to workflow logs. Create repository secrets with `gh secret set SECRET_NAME`, or add environment and organization secrets with `--env` and `--org`.

## See also

- [github-actions-workflow-basics](https://iinventedlight.com/library/notes/github-actions-workflow-basics/)
- [github-cli-gh](https://iinventedlight.com/library/notes/github-cli-gh/)
- [github-actions-composite-actions](https://iinventedlight.com/library/notes/github-actions-composite-actions/)
- [github-actions-job-outputs](https://iinventedlight.com/library/notes/github-actions-job-outputs/)

## Claims

- id: C1
  claim: Use the secrets context to access repository secrets in a workflow.
  source: S1
  evidence: "use the `secrets` context to access secrets"

- id: C2
  claim: Secrets cannot be referenced directly in if conditionals.
  source: S1
  evidence: "Secrets cannot be directly referenced in `if:` conditionals"

- id: C3
  claim: Secrets store sensitive information at organization, repository, or environment scope.
  source: S2
  evidence: "store sensitive information in your organization, repository, or repository environments"

- id: C4
  claim: Actions redacts GitHub secrets printed to workflow logs.
  source: S2
  evidence: "automatically redacts the contents of all"

## Sources

- [S1] Using secrets in GitHub Actions. GitHub Docs. https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets . License: CC-BY-4.0. Accessed 2026-11-17.

- [S2] About secrets (GitHub Docs source). github/docs (GitHub). https://github.com/github/docs/blob/main/content/actions/concepts/security/secrets.md . License: CC-BY-4.0. Accessed 2026-11-17.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Using secrets in GitHub Actions, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; github/docs (GitHub), About secrets (GitHub Docs source), CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
