jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

How to check event branch is not master and its a pull request in declarative pipeline? #54

Closed namjitharavind closed 5 years ago

aaronjwhiteside commented 5 years ago

Hi @namjitharavind please see the documentation on declarative pipelines, this isn't really a github pipeline plugin question.

https://jenkins.io/doc/book/pipeline/syntax/#when

I believe it should look something like this (not tested):

            when {
                allOf {
                    not {
                        branch 'master'
                    }
                    changeRequest()
                }
            }