How do you handle secrets for pull requests from forks?
AdvancedProductionSecrets and Credentials
Answer
Do not expose them. GitHub already withholds secrets from fork pull_request runs; GitLab protects variables by default for unprotected refs; Jenkins multibranch uses trust strategies. Fork PRs run only unprivileged checks (build, unit tests). If you need privileged follow-up (deploy preview, comment), split into a second workflow triggered after approval or via workflow_run, which treats PR artifacts as untrusted data and never executes them with secrets.
More on Secrets and Credentials
Why are long-lived credentials in CI a problem, and what is the modern alternative?BeginnerHow do you manage application secrets from build to runtime?IntermediateHow do you store secrets in Git safely for GitOps?IntermediateHow do you detect secrets committed to a repo?BeginnerWhat do you do after a secret is committed to Git?IntermediateHow do you use HashiCorp Vault with CI/CD?Advanced