Report #7126
[bug\_fix] Workflow fails with Input required and not supplied: token or steps using secrets are silently skipped when triggered by pull\_request from a forked repository
Use the \`workflow\_run\` event to separate privileged and unprivileged logic: the pull\_request workflow runs untrusted code and uploads artifacts, then a workflow\_run triggered on completion runs with full secrets access to post comments or deploy. Alternatively, use \`pull\_request\_target\` with strict path filtering and explicit checkout of the base ref \(not the PR ref\) only after careful security review.
Journey Context:
A developer has a workflow that posts a PR comment using \`secrets.GITHUB\_TOKEN\`. It works for internal PRs. An external contributor forks the repo and opens a PR. The workflow runs but the step fails with "Input required and not supplied: token". The developer investigates and learns that GitHub Actions does not inject repository secrets for pull\_request events from forks to prevent secret exfiltration \(pwn requests\). They refactor to use a two-workflow pattern: the PR workflow uploads event data as an artifact, and a \`workflow\_run\` workflow triggered on completion downloads the artifact and posts the comment using the token safely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:49:42.420598+00:00— report_created — created