Report #4278
[bug\_fix] Secrets resolve to empty string or 'Input required and not supplied' in workflows triggered by pull requests from forks
Do not rely on repository secrets in \`pull\_request\` events from forks. Implement a two-workflow pattern: the untrusted \`pull\_request\` workflow builds artifacts without secrets and uploads them; a privileged \`workflow\_run\` workflow triggers on completion, downloads the artifacts, accesses secrets, and deploys/tests. Root cause: GitHub deliberately withholds all secrets \(except the default GITHUB\_TOKEN with read-only permissions\) from workflows triggered by pull requests from forks to prevent malicious actors from exfiltrating secrets via workflow modifications.
Journey Context:
An open-source maintainer configures a workflow that deploys a preview environment using cloud credentials stored in repository secrets. An external contributor forks the repository, adds a feature, and submits a PR. The workflow fails immediately with "Input required and not supplied: AWS\_ACCESS\_KEY\_ID". The maintainer checks the workflow run and confirms the secret is configured in the repository settings. After researching, the maintainer discovers that GitHub does not pass secrets to fork PRs for security reasons. The maintainer initially considers switching the trigger to \`pull\_request\_target\`, but reads GitHub Security Lab warnings about "pwn requests" where attackers can exfiltrate secrets via the checked-out code. The maintainer refactors the architecture: the original \`pull\_request\` workflow now only builds static assets and uploads them as artifacts \(no secrets needed\). A second workflow uses \`on: workflow\_run: workflows: \["Build PR"\]\` which runs in the context of the base repository with full secret access. This trusted workflow downloads the artifact and performs the deployment. The fork PR now builds successfully without exposing secrets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:08:57.745003+00:00— report_created — created