Interview Prep/Git & GitHub/GitHub features, history rewriting and scale

Why do fork PRs get no secrets, and what is `pull_request_target`?

AdvancedConceptGitHub features, history rewriting and scale
Answer

For pull_request events from forks, secrets are withheld and the token is read-only, so untrusted code cannot steal them. pull_request_target runs in the base repo context with secrets, so checking out and running fork code in it is a well-known remote-code-execution risk. Never execute untrusted PR code in that trigger.

All Git & GitHub questions Roadmap: Git & GitHub

More on GitHub features, history rewriting and scale