Skip to content

How to detect a pull request from a fork #25217

Answered by jamime
jamime asked this question in Actions
Discussion options

You must be logged in to vote

I found the following works (ensure you replace org/repo).

Fork:

if: ${{ github.event.pull_request.head.repo.full_name != 'org/repo' }}

Not a fork:

if: ${{ github.event.pull_request.head.repo.full_name == 'org/repo' }}

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@eiffel-fl
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants