From 6937c098336addf3de09856cccbcdd5d6e26428d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96=2E=20Efe=20D=2E?= <67526259+skyline69@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:25:19 +0100 Subject: [PATCH] fix URLs --- .github/workflows/check-mod.yml | 23 +++++++++++++++++++++++ mods/Halo@Gemstones/meta.json | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-mod.yml b/.github/workflows/check-mod.yml index acbd31d3..6027876e 100644 --- a/.github/workflows/check-mod.yml +++ b/.github/workflows/check-mod.yml @@ -71,6 +71,29 @@ jobs: files: | mods/*/meta.json + - name: Validate Download URLs + run: | + for dir in mods/*/; do + if [ -d "$dir" ]; then + MOD_DIR="$(basename "$dir")" + META_JSON="$dir/meta.json" + + # Check if downloadURL exists and is not empty + DOWNLOAD_URL=$(jq -r '.downloadURL // empty' "$META_JSON") + if [ -z "$DOWNLOAD_URL" ]; then + echo "Error: Missing or empty downloadURL in $MOD_DIR/meta.json" + exit 1 + fi + + # Optional: Check if URL is accessible + if ! curl --output /dev/null --silent --head --fail "$DOWNLOAD_URL"; then + echo "Error: downloadURL in $MOD_DIR/meta.json is not accessible" + exit 1 + fi + fi + done + + review-and-approve: needs: validate # This job will only run after 'validate' completes successfully. runs-on: ubuntu-latest diff --git a/mods/Halo@Gemstones/meta.json b/mods/Halo@Gemstones/meta.json index 949fec6c..36764d0b 100644 --- a/mods/Halo@Gemstones/meta.json +++ b/mods/Halo@Gemstones/meta.json @@ -4,5 +4,5 @@ "categories": ["Content"], "author": "Halo / OfficialHalo", "repo": "https://github.com/0fficialHalo/Gemstones", - "downloadURL": "https://github.com/0fficialHalo/Gemstones/releases/latest/Gemstones.zip" - } \ No newline at end of file + "downloadURL": "https://github.com/0fficialHalo/Gemstones/releases/latest/download/Gemstones.zip" + }