File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 6
6
- build_nuttx
7
7
- test_host
8
8
- test_nuttx
9
- - coverage
9
+ - results
10
10
- deploy
11
11
- pre_release
12
12
- release_stage1
@@ -209,8 +209,8 @@ test_idf_examples:
209
209
- job : build_linux_armhf
210
210
- job : build_linux_arm64
211
211
212
- create_coverage_reports :
213
- stage : coverage
212
+ create_reports :
213
+ stage : results
214
214
tags :
215
215
- build
216
216
artifacts :
@@ -290,6 +290,29 @@ create_coverage_reports:
290
290
- python3 tools/list_to_metrics.py --file cov_infos/metrics_input.txt
291
291
- lcov_cobertura cov_infos/merged.info -o cov_infos/cobertura.xml
292
292
293
+ mr_auto_approve :
294
+ stage : results
295
+ tags :
296
+ - build
297
+ dependencies :
298
+ - pipeline_variables
299
+ when : on_success
300
+ script :
301
+ - >
302
+ if [[ -z ${TRIGGERED_BY_GDB_PIPELINE_BRANCH:-} && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != "master" && $CI_FULL_RUN == "1" ]]; then
303
+ api_call="https://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/67/merge_requests?source_branch=${CI_COMMIT_REF_NAME}&state=opened";
304
+ echo "${api_call}";
305
+ OPEN_MR=$(curl --header "PRIVATE-TOKEN: ${ESPCI_TOKEN}" "${api_call}");
306
+ echo $OPEN_MR;
307
+ iid=$(echo "$OPEN_MR" | python3 -c "import json; x=json.loads(input()); print(x[0]['iid'] if len(x) and 'iid' in x[0] else 0)");
308
+ target=$(echo "$OPEN_MR" | python3 -c "import json; x=json.loads(input()); print(x[0]['target_branch'] if len(x) and 'target_branch' in x[0] else "")");
309
+ if [[ $iid != "0" $target == "master" ]]; then
310
+ api_call="https://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/67/merge_requests/${iid}/approve";
311
+ echo "${api_call}";
312
+ curl --request POST --header "PRIVATE-TOKEN: ${ESPCI_TOKEN}" "${api_call}";
313
+ fi
314
+ fi
315
+
293
316
update_idf_tools :
294
317
stage : update_idf_tools
295
318
when : manual
You can’t perform that action at this time.
0 commit comments