From 66563020ca8abe7edade1fcae7daae0ae63caa79 Mon Sep 17 00:00:00 2001 From: Efe <67526259+skyline69@users.noreply.github.com> Date: Wed, 26 Mar 2025 08:04:41 +0100 Subject: [PATCH] update check-mod.yml --- .github/workflows/check-mod.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-mod.yml b/.github/workflows/check-mod.yml index 2a2c102d..02a8ea8b 100644 --- a/.github/workflows/check-mod.yml +++ b/.github/workflows/check-mod.yml @@ -23,12 +23,11 @@ jobs: id: find-changed-mods run: | # Get the list of files changed in the PR using GitHub API with PAT - FILES_CHANGED=$(curl -s -H "Authorization: token ${{ secrets.PAT_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \ - | jq -r '.[].filename') + API_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.PAT_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files") - # Filter for mod files and extract mod directories - echo "$FILES_CHANGED" | grep -E '^mods/[^/]+/' | cut -d'/' -f1-2 | sort | uniq > changed_mods.txt + # Extract filenames safely and filter for mod directories + echo "$API_RESPONSE" | jq -r '.[] | .filename' | grep -E '^mods/[^/]+/' | cut -d'/' -f1-2 | sort | uniq > changed_mods.txt # Check if any mods were found if [ ! -s changed_mods.txt ]; then @@ -149,4 +148,3 @@ jobs: steps: - name: Await Approval from Maintainers run: echo "Waiting for manual approval by maintainers..." -