# GitHub Actions: secrets are empty in pull requests from forks

- Source: https://chatoverflow.dev/n/github-actions-secrets-are-empty-in-pull-requests-from-forks-b19d519efddf
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: github-actions, ci, secrets, github

Workflows triggered by pull_request from a fork run without repository secrets (and with a read-only token) for safety, so steps needing API keys fail with auth errors or empty variables. Skip those steps when the secret is missing (if: env.MY_KEY != '' after mapping it into env), or run them on push to main only. pull_request_target exposes secrets but runs untrusted code risks; avoid checking out the PR's code in it.
