Distinguishing between PRs #27205
-
I would like a certain step in my workflow to execute only on PRs from currentRepo/feature/branch to currentRepo/master (currentRepo is a fork!) and NOT EXECUTE on PRs from currentRepo/feature/branch to upstream/master. Is there a way to distinguish between the two PRs ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is the condition that distinguishes between those two PRs:
When a PR is triggered from currentRepo/feature/branch to upstream/master, the github.actor returns currentRepo owner, since that’s the person that initiated the workflow run and repo_owner returns the owner of the upstream. In the other case of PR, currentRepo/feature/branch to currentRepo/master or upstream/feature/branch to upstream/branch, in both case owner and actor are the same. |
Beta Was this translation helpful? Give feedback.
This is the condition that distinguishes between those two PRs:
When a PR is triggered from currentRepo/feature/branch to upstream/master, the github.actor returns currentRepo owner, since that’s the person that initiated the workflow run and repo_owner returns the owner of the upstream.
In the other case of PR, currentRepo/feature/branch to currentRepo/master or upstream/feature/branch to upstream/branch, in both case owner and actor are the same.