Skip to content

Commit 369655d

Browse files
committed
update
1 parent c7136e9 commit 369655d

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/actions/is-commit/action.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff 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
@@ -71,6 +74,7 @@ runs:
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

0 commit comments

Comments
 (0)