Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Secrets · GitHub Actions

Direct answer

Secrets in GitHub Actions are encrypted values stored at repository, environment or organization level and read as ${{ secrets.NAME }}. They are masked in logs and not passed to forked pull requests.

First 30 seconds

1. Secrets are encrypted and masked in logs.

2. Scope to environments.

3. Not available to fork PRs.

4. Prefer OIDC to cloud providers.

5. Rotate and remove unused secrets.

Operational verification

secret → environment/job → masked env var

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
GitHub Actions workflow automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformGitHub Actions workflow automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when using secrets in GitHub Actions.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as event filter surprises, unpinned actions, secret/permission overreach, runner drift, matrix partial failure, artifact confusion and assuming conclusion=success shows external convergence, choosing the cases most relevant to secret object identity, encryption-at-rest limitations, RBAC/service-account access, projection/environment exposure and rotation without logging secret values.

Step 2 Common mistakes Narrow the fault
  • Secrets in workflow files.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Secrets exist at repository, environment and organization level.
  • They are masked in logs.
  • Secrets are not available to workflows from forks.
Key checks
  • gh secret list — repo secrets
  • gh secret list --env <env> — environment secrets
  • OIDC (id-token: write) instead of cloud keys — federation
ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Secrets in GitHub Actions store sensitive values encrypted at organisation, repository or environment level. Workflows read them through the secrets context, and GitHub masks their values in logs.

Important behaviours:

  • Secrets are not passed to workflows triggered by pull requests from forks, protecting them from untrusted code.
  • Environment secrets are only available to jobs that target that environment, which can require approval.
  • Masking only hides exact values; printing a transformed secret can leak it.
jobs:
  deploy:
    environment: production
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh
        env:
          API_TOKEN: ${{ secrets.PROD_API_TOKEN }}

For cloud access, prefer OpenID Connect (permissions: id-token: write) over long-lived keys: the workflow exchanges a short-lived token for cloud credentials, so no cloud secret is stored in GitHub at all.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Secrets belong in the platform's intended secret store and must not be copied into generated examples, logs or audit output.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docGitHub Actions workflow automation current

Authoritative/upstream documentation reviewed for bounded claims in GitHub Actions > Secrets. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For secret object identity, encryption-at-rest limitations, RBAC/service-account access, projection/environment exposure and rotation without logging secret values, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?