Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 2
Message 1 of 2

Event pull_request_review restrict PR base branch

For event pull_request_review is it possible to trigger workflow only when the review is submitted on a PR whose base branch is master.

This workflow shouldn't get triggered on reviews on any other branch other than master.

1 Reply
GitHub Staff
Message 2 of 2

Re: Event pull_request_review restrict PR base branch


@nikhilaii93 - It's possible to limit the types of activity that will trigger a workflow run using the `types` field:


Here's an example workflow that triggers on the `pull_request_review` event only when a review is `submitted`:


    types: [submitted]


In the job, you can use the `if` conditional at the `job` level and the `github` context to run said job only if the base ref is `master`:


Here's an example:


    if: github.base_ref == 'master'


Hope this helps!