Distinguishing between PRs

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 ?

This is the condition that distinguishes between those two PRs:

- if: github.repository_owner != github.actor

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.

1 Like