Report #7597
[bug\_fix] Secrets appear empty or undefined when workflow is triggered by Dependabot or from a forked repository.
For Dependabot-triggered workflows, navigate to Settings > Security > Secrets and variables > Dependabot and explicitly add the required secrets there; repository secrets are not inherited by Dependabot. For workflows triggered by forks, secrets are intentionally not passed to prevent exfiltration. To handle this, refactor sensitive operations \(like deployments\) into a separate workflow that triggers via \`workflow\_run\` \(which runs in the base repository context with access to secrets\) after the untrusted CI workflow completes, or use \`pull\_request\_target\` with strict security controls \(avoid checking out untrusted code for execution\).
Journey Context:
A development team has a deployment workflow that uses a cloud API key stored in \`secrets.CLOUD\_API\_KEY\` to create preview environments for every PR. Internal PRs work perfectly. However, when Dependabot opens a PR to update a dependency, the workflow fails immediately with "Input required and not supplied: api-key", despite the secret existing in the repository settings. The developer verifies the secret is spelled correctly and is available in the repository's Actions secrets. After adding debug steps, they confirm \`secrets.CLOUD\_API\_KEY\` evaluates to an empty string. Searching the error leads to GitHub documentation explaining that Dependabot has an isolated secrets environment. The developer navigates to Settings > Security > Secrets and variables > Dependabot and adds \`CLOUD\_API\_KEY\` there. The next Dependabot PR triggers the workflow successfully. Later, they notice the same empty secret issue for external forks. They realize this is intentional for security. To support external contributors, they split the workflow: an untrusted \`ci.yml\` runs tests on the fork code \(without secrets\), and upon success, it triggers a \`deploy.yml\` via \`workflow\_run\`, which runs in the base repo context with access to secrets to create the preview environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:14:53.021340+00:00— report_created — created