pull_request vs pull_request_target
A workflow on pull_request_target checks out the PR's head commit and runs npm test. Why is this dangerous for a public repository?
pull_request_target
npm test
Choose one answer
The PR's head commit can't be checked out, so the tests silently run on main.
main
pull_request_target workflows never run for pull requests opened from forks.
The fork's code runs with a write token and access to the repository's secrets.
It doubles the CI minutes, because both trigger types always run together.