Jenkins pipeline determine if a branch is for Bitbucket pull request
问题 I'm using Jenkins together with the Bitbucket branch source plugin. Everything works great, but I want to be able to run/exclude certain stages in my pipeline depending on whether the branch is associated with a pull request or not, such as: pipeline { stages { stage('build') { //compile } stage('package') { when { environment name: 'IS_PULL_REQUEST', value: 'true' } //create deployable package } } } Jenkins knows when the branch is for a PR because it merges the source with the target and