Skip to content

Preventing a step from running on a PR originating from a fork. #25125

Answered by BrightRan
sandoichi asked this question in Actions
Discussion options

You must be logged in to vote

@sandoichi ,

There are three properties of github context you need to know:
1) github.repository – the repository where the workflow is currently running.

2) github.event.pull_request.base.repo.full_name – the repository where the target branch is located. It is same with github.repository.

3) github.event.pull_request.head.repo.full_name – the repository where the source branch is located.

According to the three properties:
1) If the PR is merging between branches in the same repository, the value of these three properties are the same.

2) If the PR is merging from a forked repository, the property github.event.pull_request.head.repo.full_name is different with github.event.pull_request.…

Replies: 3 comments

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants