An outside contributor's PR from a fork should run CI, but your workflow needs secrets.
AdvancedScenarioRemotes, Collaboration and Pull Requests
Answer
Situation read → Secrets are not passed to workflows triggered by fork PRs, for good reason: the fork's code is untrusted.
What I'd do →
- Keep
pull_requestfor tests that need no secrets. Fork PRs get a read-only token. - For label or comment automation, use
pull_request_targetonly if you never check out or run PR code with it. - Require approval for first-time contributors (Settings → Actions → Fork pull request workflows).
- For real integration tests, a maintainer pushes the contributor's commit to a branch in the main repo after review.
Why → pull_request_target runs in the base repo's context with secrets. Running untrusted code there is a well-known compromise path.
Interview tip → Name "pwn request" as the risk. It signals real security awareness.
More on Remotes, Collaboration and Pull Requests
You are new to a team. How do you collaborate daily without stepping on others' toes?BeginnerYou are migrating a repo from Bitbucket to GitHub and must keep every branch and tag.IntermediateYou want to contribute a fix to an open-source project you do not have write access to.BeginnerA teammate sent a 3,000-line PR and nobody can review it properly.IntermediateA reviewer asks for changes. How do you update the PR cleanly?BeginnerYour team wants stacked PRs so that large work arrives in small reviewable steps. How do you set it up?Advanced