File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ parameters:
2525 Due to concurrency issues, how many times should we requery the pipeline list to ensure previous jobs are "pending",
2626 but not yet active. This number indicates the threshold for API returning no previous pending pipelines.
2727 Default is one confirmation, increase if you see issues.
28+ include-on-hold :
29+ type : boolean
30+ default : true
31+ description : Consider on-hold workflows waiting for approval as running and include them in the queue.
2832
2933steps :
3034 - run :
3539 CONFIG_DONT_QUIT : " << parameters.dont-quit >>"
3640 CONFIG_ONLY_ON_BRANCH : " << parameters.only-on-branch >>"
3741 CONFIG_CONFIDENCE : " << parameters.confidence >>"
42+ CONFIG_INCLUDE_ON_HOLD : " << parameters.include-on-hold >>"
3843 command : <<include(scripts/queue.sh)>>
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ parameters:
2929 Due to concurrency issues, how many times should we requery the pipeline list to ensure previous jobs are "pending",
3030 but not yet active. This number indicates the threshold for API returning no previous pending pipelines.
3131 Default is one confirmation, increase if you see issues.
32+ include-on-hold :
33+ type : boolean
34+ default : true
35+ description : Consider on-hold workflows waiting for approval as running and include them in the queue.
3236
3337steps :
3438 - block_execution :
3741 dont-quit : <<parameters.dont-quit>>
3842 only-on-branch : <<parameters.only-on-branch>>
3943 confidence : <<parameters.confidence>>
44+ include-on-hold : <<parameters.include-on-hold>>
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ fetch_pipeline_workflows(){
6666 created_at=$( jq -r ' .items[] | .created_at' " ${pipeline_detail} " )
6767 debug " Pipeline's workflow was created at: ${created_at} "
6868 done
69- jq -s ' [.[].items[] | select((.status == "running") or (.status == "created"))]' ${tmp} /pipeline-* .json > ${workflows_file}
69+ if [ " ${CONFIG_INCLUDE_ON_HOLD} " == " 1" ]; then
70+ active_statuses=' ["running","created","on_hold"]'
71+ else
72+ active_statuses=' ["running","created"]'
73+ jq -s ' [.[].items[] | select([.status] | inside(' ${active_statuses} ' ))]' ${tmp} /pipeline-* .json > ${workflows_file}
7074}
7175
7276# parse workflows to fetch parmeters about this current running workflow
You can’t perform that action at this time.
0 commit comments