Skip to content
Discussion options

You must be logged in to vote

What's the difference between pull_request and pull_request_target triggers, and why might using the wrong one be a security issue?

pull_request vs pull_request_target
Both trigger workflows on pull request events, but they differ in what context the workflow runs under, which determines what permissions and secrets are available.

pull_request
The workflow runs in the merge commit of the PR's branch, using the workflow from the PR's base branch. It has read-only token permissions by default and cannot access secrets from the target repository.

Runs code from the fork/feature branch
Uses the workflow definition from the base branch (for security)
Token has read-only permissions
No access…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sudoUgando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants