diff --git a/.github/workflows/detect-pr-pipeline.yaml b/.github/workflows/detect-pr-pipeline.yaml index 8cc600a..0c343bb 100644 --- a/.github/workflows/detect-pr-pipeline.yaml +++ b/.github/workflows/detect-pr-pipeline.yaml @@ -23,7 +23,7 @@ jobs: run: | git clone --depth=1 "https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.farh.net/${{ github.repository }}.git" . git fetch origin "$BASE_REF" --depth=1 - git fetch origin "$HEAD_REF" --depth=1 + git fetch origin +refs/pull/*/head:refs/pull/*/head --depth=1 git checkout "${{ github.sha }}" - name: Run detection tests @@ -45,13 +45,15 @@ jobs: run: | git clone --depth=1 "https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.farh.net/${{ github.repository }}.git" . git fetch origin "$BASE_REF" --depth=1 - git fetch origin "$HEAD_REF" --depth=1 + git fetch origin +refs/pull/*/head:refs/pull/*/head --depth=1 git checkout "${{ github.sha }}" - name: Get changed files run: | mkdir -p /tmp/pr-detect - git diff --name-only "origin/$BASE_REF" HEAD > /tmp/pr-detect/changed_files.txt + git fetch origin "$BASE_REF" --depth=1 2>/dev/null + git fetch origin +refs/pull/*/head:refs/pull/*/head --depth=1 2>/dev/null + git diff --name-only "origin/$BASE_REF"...HEAD > /tmp/pr-detect/changed_files.txt echo "Files found: $(wc -l < /tmp/pr-detect/changed_files.txt)" cat /tmp/pr-detect/changed_files.txt