diff --git a/.github/workflows/check-code-and-unit-test.yaml b/.github/workflows/check-code-and-unit-test.yaml index 405934fef4f..5b2444980f2 100644 --- a/.github/workflows/check-code-and-unit-test.yaml +++ b/.github/workflows/check-code-and-unit-test.yaml @@ -31,13 +31,21 @@ jobs: DEFAULT_LABELS=("dashboard" "consent" "pay" "core" "api-keys" "notifications" "admin-panel" "map") LABELS=($(jq -r '.[]' < labels.json)) - if [ ${#LABELS[@]} -eq 0 ]; then - LABELS=("${DEFAULT_LABELS[@]}") - elif [ ${#LABELS[@]} -eq 1 ] && [ "${LABELS[0]}" = "ci" ]; then - LABELS=("${DEFAULT_LABELS[@]}") + + found_ci=0 + for label in "${LABELS[@]}"; do + if [ "$label" = "ci" ]; then + found_ci=1 + break + fi + done + + UPDATED_LABELS=("${LABELS[@]}") + if [ ${#LABELS[@]} -eq 0 ] || [ $found_ci -eq 1 ]; then + UPDATED_LABELS=("${DEFAULT_LABELS[@]}") fi - for LABEL in "${LABELS[@]}"; do + for LABEL in "${UPDATED_LABELS[@]}"; do case "$LABEL" in dashboard|consent|pay|admin-panel|map) ARGS+=" //apps/$LABEL:test" diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 4d9234f3af1..5f050a88fb7 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -29,13 +29,21 @@ jobs: DEFAULT_LABELS=("dashboard" "consent" "pay" "core" "admin-panel" "map") LABELS=($(jq -r '.[]' < labels.json)) - if [ ${#LABELS[@]} -eq 0 ]; then - LABELS=("${DEFAULT_LABELS[@]}") - elif [ ${#LABELS[@]} -eq 1 ] && [ "${LABELS[0]}" = "ci" ]; then - LABELS=("${DEFAULT_LABELS[@]}") + + found_ci=0 + for label in "${LABELS[@]}"; do + if [ "$label" = "ci" ]; then + found_ci=1 + break + fi + done + + UPDATED_LABELS=("${LABELS[@]}") + if [ ${#LABELS[@]} -eq 0 ] || [ $found_ci -eq 1 ]; then + UPDATED_LABELS=("${DEFAULT_LABELS[@]}") fi - for LABEL in "${LABELS[@]}"; do + for LABEL in "${UPDATED_LABELS[@]}"; do case "$LABEL" in dashboard|consent|pay|core|admin-panel|map) ARGS+=" $LABEL"