File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,14 +120,18 @@ jobs:
120120 exit 0
121121 fi
122122
123- if jq -e --arg label "$PLATFORM_LABEL" 'index($label) != null or index("ci:mobile") != null' <<< "$PR_LABELS" >/dev/null; then
124- if jq -e --arg label "$PLATFORM_LABEL" 'index($label) != null' <<< "$PR_LABELS" >/dev/null; then
125- set_decision true "$PLATFORM_LABEL label"
126- else
127- set_decision true "ci:mobile label"
128- fi
129- exit 0
130- fi
123+ label_match="$(
124+ jq -er --arg platform_label "$PLATFORM_LABEL" '
125+ if index($platform_label) != null then "platform"
126+ elif index("ci:mobile") != null then "mobile"
127+ else "none"
128+ end
129+ ' <<< "$PR_LABELS"
130+ )"
131+ case "$label_match" in
132+ platform) set_decision true "$PLATFORM_LABEL label"; exit 0 ;;
133+ mobile) set_decision true "ci:mobile label"; exit 0 ;;
134+ esac
131135
132136 if [[ "$PR_DRAFT" == "true" ]]; then
133137 set_decision false "draft PR without $PLATFORM_LABEL or ci:mobile label"
You can’t perform that action at this time.
0 commit comments