@@ -48,23 +48,20 @@ jobs:
4848 # Get latest release tag
4949 RELEASE_TAG=$(echo $RESPONSE | jq -r '.tag_name')
5050
51- # Get the first downloadable asset URL (if exists)
52- LATEST_RELEASE=$(echo $RESPONSE | jq -r '.assets[0].browser_download_url')
51+ # Extract the first .jar file asset URL from the release
52+ LATEST_RELEASE=$(echo $RESPONSE | jq -r '[ .assets[] | select(.name | endswith(".jar"))] [0].browser_download_url')
5353
54- # Fallback: Use the release page if no direct download is available
54+ # If no .jar file is found, skip this repo
5555 if [[ "$LATEST_RELEASE" == "null" || -z "$LATEST_RELEASE" ]]; then
56- if [[ "$RELEASE_TAG" != "null" && -n "$RELEASE_TAG" ]]; then
57- LATEST_RELEASE="https://github.com/$OWNER/$REPO/releases/tag/$RELEASE_TAG"
58- else
59- echo "::warning file=badges.json,title=No Releases Found::$OWNER/$REPO has no releases."
60- continue
61- fi
56+ echo "::warning file=badges.json,title=No JAR File Found::$OWNER/$REPO has no JAR file in its latest release."
57+ continue
6258 fi
6359
60+ # Compare stored latest release URL with the actual one
6461 if [[ "$LATEST_STORED" != "$LATEST_RELEASE" ]]; then
6562 echo "::error file=badges.json,title=Outdated Release::$OWNER/$REPO"
6663 echo "::error file=badges.json,title=Stored URL::$LATEST_STORED"
67- echo "::error file=badges.json,title=Latest URL::$LATEST_RELEASE"
64+ echo "::error file=badges.json,title=Latest JAR URL::$LATEST_RELEASE"
6865 echo "-----------------------------------"
6966 OUTDATED_PLUGINS=1
7067 fi
0 commit comments