From 5ac5f27d8bd3ae76c56048de81c511bee0b5d7b4 Mon Sep 17 00:00:00 2001 From: Alexander Taepper Date: Thu, 17 Oct 2024 17:35:53 +0200 Subject: [PATCH] chore: fix linting of large PRs by requesting more files in the GitHub api call resolves #606 --- .github/workflows/linter.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e4ee03a4..ddb4861c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -89,9 +89,20 @@ jobs: mv /src/build . cmake -DBUILD_WITH_CLANG_TIDY=on -D CMAKE_BUILD_TYPE=Debug -B build echo "Successfully configured cmake" - files=$(curl -s \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}/files" \ + files="" + PAGE=1 + while true; do + page_files=$(curl -s \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}/files?per_page=100&page=$PAGE" \ | jq -r '.[] | select(.status != "removed") | .filename') + # If there are no more files, break the loop + if [[ -z "$page_files" ]]; then + break + fi + files+="$page_files"$'\n' + PAGE=$((PAGE + 1)) + done + echo "Changed files of this PR:" echo "$files" IFS=$'\n'