File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 elif [ "$total_count" -gt 1 ]; then
4444 echo "valid=false" >> "$GITHUB_OUTPUT"
4545 echo "message=Only one report label is allowed: \`report: include\`, \`report: exclude\` OR \`report: highlight\`." >> "$GITHUB_OUTPUT"
46+ fi
47+
48+ feature_flag_count="$(jq '[.[] | select(.name == "feature flag")] | length' <<< "$labels_json")"
49+ if [ "$feature_flag_count" -gt 0 ]; then
50+ pr_body='${{ toJson(github.event.pull_request.body) }}'
51+ pr_feature_flag_key="$(jq -nr --arg body "$pr_body" 'try ($body | gsub("\r"; "") | capture("(?m)^feature-flag:\\s*`(?<flag>[^`]+)`$").flag) catch ""')"
52+ if [ -z "$pr_feature_flag_key" ]; then
53+ echo "valid=false" >> "$GITHUB_OUTPUT"
54+ echo "message=PR body must contain the feature flag key in the format: \`feature-flag: \\\`<feature-flag-key>\\\`\`." >> "$GITHUB_OUTPUT"
55+ else
56+ echo "valid=true" >> "$GITHUB_OUTPUT"
57+ fi
4658 else
4759 echo "valid=true" >> "$GITHUB_OUTPUT"
4860 fi
You can’t perform that action at this time.
0 commit comments