Skip to content

Commit e4eff03

Browse files
committed
ci: fix downstream job selection for PRs with CHANGE_TARGET
this will be replaced with better solution in v2 Signed-off-by: Thomas Stilwell <[email protected]>
1 parent d0790e9 commit e4eff03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Jenkinsfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ pipeline {
174174
when { expression { CI_STATE.NRF.RUN_DOWNSTREAM } }
175175
steps { script {
176176
CI_STATE.NRF.WAITING = true
177+
177178
def DOWNSTREAM_JOBS = lib_Main.getDownStreamJobs(JOB_NAME)
179+
if ( (CI_STATE.NRF.BUILD_TYPE == "PR") && CI_STATE.NRF.containsKey('CHANGE_TARGET') ) {
180+
def NEW_JOB_NAME = JOB_NAME.replace(CI_STATE.NRF.BRANCH_NAME, CI_STATE.NRF.CHANGE_TARGET)
181+
println "INFO: new JOB_NAME based on PR target branch."
182+
DOWNSTREAM_JOBS = lib_Main.getDownStreamJobs(NEW_JOB_NAME)
183+
}
178184
if (DOWNSTREAM_JOBS.size() == 1){
179185
DOWNSTREAM_JOBS.add("thst/test-ci-nrfconnect-cfg-null/lib")
180186
}

0 commit comments

Comments
 (0)