diff --git a/.github/workflows/multi_auto_snapshot_update.yml b/.github/workflows/multi_auto_snapshot_update.yml index 1571ef1..bc72d69 100644 --- a/.github/workflows/multi_auto_snapshot_update.yml +++ b/.github/workflows/multi_auto_snapshot_update.yml @@ -44,8 +44,13 @@ jobs: run: | MC_VERSION="${{ inputs.mc_version }}" if [ -z "$MC_VERSION" ]; then - MC_VERSION=$(curl -s https://launchermeta.mojang.com/mc/game/version_manifest.json \ - | jq -r '.latest.snapshot') + RESPONSE=$(curl -s https://launchermeta.mojang.com/mc/game/version_manifest.json) + MC_VERSION=$(echo "$RESPONSE" | jq -r '.latest.snapshot') + if [ -z "$MC_VERSION" ]; then + echo "No latest Minecraft snapshot found" + echo "Response: $RESPONSE" + exit 1 + fi fi echo "mc_version=$MC_VERSION" >> $GITHUB_OUTPUT echo "Minecraft version: \`$MC_VERSION\`" >> $GITHUB_STEP_SUMMARY @@ -63,6 +68,7 @@ jobs: echo "Loader version: \`$LOADER_VERSION\`" >> $GITHUB_STEP_SUMMARY else echo "No yarn/loader versions found for ${{ steps.get_mc_version.outputs.mc_version }}" + echo "Response: $RESPONSE" exit 1 fi - name: Get Fabric API version @@ -70,17 +76,18 @@ jobs: run: | FAPI_VERSION="${{ inputs.fapi_version }}" if [ -z "$FAPI_VERSION" ]; then + MC_VERSION="${{ steps.get_mc_version.outputs.mc_version }}" RESPONSE=$(curl -s \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "https://api.github.com/repos/FabricMC/fabric/releases?per_page=100") - MC_VERSION="${{ steps.get_mc_version.outputs.mc_version }}" FAPI_VERSION=$(echo "$RESPONSE" \ | jq -r --arg MC_VERSION "$MC_VERSION" \ '.[] | select(.name | contains($MC_VERSION)) | .tag_name' \ | head -n 1) if [ -z "$FAPI_VERSION" ]; then echo "No Fabric API version found for $MC_VERSION" + echo "Response: $RESPONSE" exit 1 fi fi @@ -91,11 +98,17 @@ jobs: run: | CF_GAME_VERSION="${{ inputs.cf_game_version }}" if [ -z "$CF_GAME_VERSION" ]; then - CF_GAME_VERSION=$(curl -s \ + RESPONSE=$(curl -s \ -H "Accept: application/json" \ -H "x-api-key: ${{ secrets.CURSEFORGE_API_KEY }}" \ - "https://api.curseforge.com/v1/games/minecraft/mods/306612/files?pageSize=1" \ + "https://api.curseforge.com/v1/games/minecraft/mods/306612/files?pageSize=1") + CF_GAME_VERSION=$(echo "$RESPONSE" \ | jq -r '.data[0].gameVersions[] | select(. != "Fabric")') + if [ -z "$CF_GAME_VERSION" ]; then + echo "No CurseForge game version found for ${{ steps.get_mc_version.outputs.mc_version }}" + echo "Response: $RESPONSE" + exit 1 + fi fi echo "cf_game_version=$CF_GAME_VERSION" >> $GITHUB_OUTPUT echo "CurseForge game version: \`$CF_GAME_VERSION\`" >> $GITHUB_STEP_SUMMARY