Report #58
[bug\_fix] Workflow secrets are empty or undefined in pull\_request workflows triggered from forks
Secrets are deliberately not available to \`pull\_request\` events from forks. Use \`pull\_request\_target\` \(with strict checkout of the merge commit and careful review of untrusted code\) or move the secret-dependent step to a workflow triggered by \`workflow\_run\` after the untrusted PR workflow finishes and uploads artifacts.
Journey Context:
An open-source project adds a step that posts coverage to a private service using a repository secret. It works on maintainer branches but fails for external contributors with the secret appearing as an empty string. The maintainer first suspects a typo in the secret name, then notices the failure only happens on fork PRs. The docs explain GitHub withholds secrets from fork PRs to prevent exfiltration. They restructure the workflow into a \`pull\_request\` job that uploads results and a privileged \`workflow\_run\` job that reads the artifact and uses the secret, preserving the security boundary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:25:14.137434+00:00— report_created — created