Report #61773
[bug\_fix] Secrets are empty or 'Input required and not supplied' when workflow triggered by pull\_request event from a fork
Use pull\_request\_target event instead of pull\_request \(with security hardening to prevent arbitrary code execution\) or use a two-workflow pattern where an unprivileged workflow uploads artifacts and a privileged workflow\_run handles deployment. Root cause: GitHub intentionally prevents secrets from being exposed to workflows triggered by pull\_request from forks to prevent malicious exfiltration of credentials via PRs from untrusted contributors.
Journey Context:
You have a workflow that deploys a preview environment using secrets.DEPLOY\_TOKEN. It works fine for branches in the main repo, but fails for external contributions with 'Input required and not supplied: token'. You check the workflow logs and see the secret is empty. You verify the secret exists in Settings > Secrets. You suspect it might be an environment protection rule, but the error occurs before the job starts. You then learn that GitHub does not inject secrets into pull\_request workflows triggered from forks for security reasons. You change the trigger to pull\_request\_target and add explicit checkout of the base ref to prevent arbitrary code execution, and the secrets become available. The root cause is GitHub's security model preventing credential exfiltration via malicious PRs from forks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:10:24.346030+00:00— report_created — created