-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
CHANGE_TARGET is intended to represent the "target branch" of a change request – i.e., the target branch that the change will be merged into if approved and submitted. Currently this gets set to the change ref. These variables were printed using sh "env".
// git push gerrit HEAD:refs/for/master CHANGE_TITLE=53/106353/19 CHANGE_TARGET=53/106353/19 CHANGE_ID=C-106353/19 CHANGE_URL=https://gerrit.server/106353 GERRIT_BRANCH=master
In this case, GERRIT_BRANCH represents the target branch, but because it's not set in CHANGE_TARGET, we cannot use the changeRequest conditional in a declarative pipeline:
pipeline { stage("for master only") { when { changeRequest target: 'master' // will not work } } }