@@ -372,7 +372,7 @@ function handle_templatesyncignore() {
372
372
# Logic
373
373
# ######################################################
374
374
375
- function prechecks () {
375
+ function arr_prechecks () {
376
376
info " prechecks"
377
377
echo " ::group::prechecks"
378
378
if [ " ${IS_FORCE_PUSH_PR} " == " true" ]; then
@@ -387,7 +387,7 @@ function prechecks() {
387
387
}
388
388
389
389
390
- function checkout_branch_and_pull () {
390
+ function arr_checkout_branch_and_pull () {
391
391
info " checkout branch and pull"
392
392
cmd_from_yml " prepull"
393
393
@@ -409,7 +409,7 @@ function checkout_branch_and_pull() {
409
409
}
410
410
411
411
412
- function commit () {
412
+ function arr_commit () {
413
413
info " commit"
414
414
415
415
cmd_from_yml " precommit"
@@ -428,7 +428,20 @@ function commit() {
428
428
}
429
429
430
430
431
- function push_prepare_pr_create_pr() {
431
+ function arr_push() {
432
+ info " push"
433
+
434
+ echo " ::group::push"
435
+ if [ " $IS_DRY_RUN " == " true" ]; then
436
+ warn " dry_run option is set to on. skipping push"
437
+ return 0
438
+ fi
439
+ cmd_from_yml " prepush"
440
+ push " ${PR_BRANCH} " " ${IS_FORCE_PUSH_PR} "
441
+ echo " ::endgroup::"
442
+ }
443
+
444
+ function arr_push_prepare_pr_create_pr() {
432
445
info " push_prepare_pr_create_pr"
433
446
if [ " $IS_DRY_RUN " == " true" ]; then
434
447
warn " dry_run option is set to on. skipping labels check, cleanup older PRs, push and create pr"
@@ -456,8 +469,6 @@ function push_prepare_pr_create_pr() {
456
469
457
470
echo " ::group::push changes and create PR"
458
471
459
- cmd_from_yml " prepush"
460
- push " ${PR_BRANCH} " " ${IS_FORCE_PUSH_PR} "
461
472
cmd_from_yml " prepr"
462
473
if [ " $IS_FORCE_PUSH_PR " == true ] ; then
463
474
create_or_edit_pr " ${PR_TITLE} " " ${PR_BODY} " " ${UPSTREAM_BRANCH} " " ${PR_LABELS} " " ${PR_REVIEWERS} "
@@ -471,16 +482,16 @@ function push_prepare_pr_create_pr() {
471
482
472
483
declare -A arr
473
484
474
- arr[" pull " ]=checkout_branch_and_pull
475
- arr[" commit " ]=commit
476
- arr[" pr " ]=push_prepare_pr_create_pr
477
-
478
- prechecks
479
-
480
- checkout_branch_and_pull
481
-
482
- commit
483
-
484
- push_prepare_pr_create_pr
485
+ arr[" prechecks " ]=arr_prechecks
486
+ arr[" pull " ]=arr_checkout_branch_and_pull
487
+ arr[" commit " ]=arr_commit
488
+ arr[ " push " ]=arr_push
489
+ arr[ " pr " ]=arr_push_prepare_pr_create_pr
490
+
491
+ ${arr["prechecks"]}
492
+ ${arr["pull"]}
493
+ ${arr[" commit"]}
494
+ ${arr["push"]}
495
+ ${arr["pr"]}
485
496
486
497
set_github_action_outputs " ${PR_BRANCH} " " ${TEMPLATE_GIT_HASH} "
0 commit comments