File tree Expand file tree Collapse file tree
.github/actions/is-commit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,15 @@ runs:
3636
3737 # Debug info
3838 echo "API Response:"
39- echo "$response" | jq '.'
39+ echo "$response" | jq 2>/dev/null || echo "Failed to parse JSON response"
4040
41- # Check if response is an error
42- error=$(echo "$response" | jq -r '.message // empty')
43- if [ ! -z "$error" ]; then
44- echo "::warning::API Error: $error"
41+ # Проверяем, является ли ответ массивом или объектом с сообщением об ошибке
42+ is_array=$(echo "$response" | jq 'if type=="array" then true else false end')
43+ if [ "$is_array" = "false" ]; then
44+ # Если это не массив, проверяем наличие сообщения об ошибке
45+ error=$(echo "$response" | jq -r '.message // empty')
46+ echo "::warning::API Response is not an array. Possible error: $error"
47+
4548 # Fallback to search API for merged PRs
4649 echo "Trying alternative method to detect PR association..."
4750
7174 echo "PR Numbers: $pr_numbers"
7275 echo "pr_numbers=$pr_numbers" >> $GITHUB_OUTPUT
7376 echo "proceed=false" >> $GITHUB_OUTPUT
77+ exit 0
7478 else
7579 echo "No PR associated → normal commit"
7680 echo "proceed=true" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments