Report #53570
[bug\_fix] Secrets are empty or null when pull request originates from a fork
Use \`workflow\_run\` event triggered by workflow completion to separate untrusted code execution from secret access, or use \`pull\_request\_target\` with strict security hardening \(path pinning, label checks\)
Journey Context:
Developer sets up a workflow posting comments on PRs using secrets.BOT\_TOKEN. It works for internal PRs. A community member forks the repo and submits a PR. The workflow runs but fails with 'Error: Input required and not supplied: token'. Debug logging shows the secret is empty. They search and find GitHub's security model: secrets are not passed to workflows triggered by pull\_request events from forks, preventing exfiltration by malicious code. The developer considers pull\_request\_target which runs in base repo context with secrets, but learns about 'pwn requests' security risks. They implement the established pattern: use pull\_request to upload artifacts \(untrusted\), then workflow\_run triggered by completion to process with secrets. This separates untrusted code execution from secret access, satisfying both security and functionality requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:24:48.981907+00:00— report_created — created