Skip to content

Commit ac8a2a2

Browse files
authored
Update check-badges.yml
1 parent 04459c4 commit ac8a2a2

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/check-badges.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,32 @@ jobs:
4848
4949
# Ensure the API response is valid
5050
if [[ "$RESPONSE" == "null" || -z "$RESPONSE" ]]; then
51-
echo "⚠️ Failed to fetch release data for $OWNER/$REPO."
51+
echo "⚠️ GitHub API returned null response for $OWNER/$REPO. Skipping..."
5252
continue
5353
fi
5454
55-
# Extract the latest .jar file URL
55+
# Check if the repository has any releases
56+
RELEASE_CHECK=$(echo "$RESPONSE" | jq -r 'if .tag_name then "exists" else "no_release" end')
57+
58+
if [[ "$RELEASE_CHECK" == "no_release" ]]; then
59+
echo "⚠️ No releases found for $OWNER/$REPO. Skipping..."
60+
continue
61+
fi
62+
63+
# Ensure assets exist before trying to extract them
64+
ASSETS_EXIST=$(echo "$RESPONSE" | jq -r 'if .assets then "exists" else "no_assets" end')
65+
66+
if [[ "$ASSETS_EXIST" == "no_assets" ]]; then
67+
echo "⚠️ No assets found in the latest release for $OWNER/$REPO. Skipping..."
68+
continue
69+
fi
70+
71+
# Extract the first .jar file URL
5672
LATEST_RELEASE=$(echo "$RESPONSE" | jq -r '[.assets[] | select(.name | endswith(".jar"))][0].browser_download_url')
5773
5874
# Skip if no JAR file is found
5975
if [[ "$LATEST_RELEASE" == "null" || -z "$LATEST_RELEASE" ]]; then
76+
echo "⚠️ No JAR file found for $OWNER/$REPO. Skipping..."
6077
continue
6178
fi
6279

0 commit comments

Comments
 (0)