Skip to content

Is there a way to tell if a PR is from a forked repository? #26829

Answered by BrightRan
Senui asked this question in Actions
Discussion options

You must be logged in to vote

@senui ,
When the workflow is triggered by the events that are related to pull request ( pull_request, pull_request_review, pull_request_review_comment or pull_request_target), from the github context of the workflow run, you can get the following three properties:

  • github.event.pull_request.base.repo.full_name - - The full name of PR’s base (target) repository (owner-name/repo-name).

  • github.event.pull_request.head.repo.full_name - - The full name of PR’s head (source) repository (owner-name/repo-name).

  • github.repository - - The full name of the repository where the PR is in. Normally this property is equal to ‘github.event.pull_request.base.repo.full_name’.

When the PR’s head bran…

Replies: 11 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@koczkatamas
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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