@@ -82,21 +82,29 @@ jobs:
8282 git config --local user.name "stdlib-bot"
8383 git fetch --all
8484
85- # Get list of changed files:
86- - name : ' Get list of changed files'
85+ # Get list of added files:
86+ - name : ' Get list of added files'
8787 if : steps.check-reviewers.outputs.is_stdlib_bot == 'true'
88- id : changed-files
89- uses : tj-actions/changed-files@v35
90- with :
91- separator : ' '
92- base_sha : ${{ github.event.pull_request.base.sha }}
93- sha : ${{ github.event.pull_request.head.sha }}
88+ id : added-files
89+ run : |
90+ page=1
91+ files=""
92+ while true; do
93+ new_files=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/stdlib-js/stdlib/pulls/${{ github.event.pull_request.number }}/files?page=$page&per_page=100" | jq -r '.[] | select(.status == "added") | .filename')
94+ if [ -z "$new_files" ]; then
95+ break
96+ fi
97+ files="$files $new_files"
98+ page=$((page+1))
99+ done
100+ files=$(echo "$files" | tr '\n' ' ' | sed 's/ $//')
101+ echo "files=${files}" >> $GITHUB_OUTPUT
94102
95103 # Check whether the pull request contains a new `README.md` file; if not, exit with a non-zero exit code:
96104 - name : ' Exit if pull request does not contain a new README.md file'
97105 if : steps.check-reviewers.outputs.is_stdlib_bot == 'true'
98106 run : |
99- if [[ ! "${{ steps.changed -files.outputs.added_files }}" =~ "README.md" ]]; then
107+ if [[ ! "${{ steps.added -files.outputs.files }}" =~ "README.md" ]]; then
100108 echo "Pull request does not contain a new README.md file."
101109 exit 1
102110 fi
@@ -120,7 +128,7 @@ jobs:
120128 "test/test.js"
121129 )
122130 # Get path of first added `README.md` file:
123- readme_path=$(echo "${{ steps.changed -files.outputs.added_files }}" | tr ' ' '\n' | grep -E 'README.md$' | head -n 1)
131+ readme_path=$(echo "${{ steps.added -files.outputs.files }}" | tr ' ' '\n' | grep -E 'README.md$' | head -n 1)
124132
125133 if grep -q '## CLI' "${readme_path}"; then
126134 required_files+=("bin/cli")
@@ -153,7 +161,7 @@ jobs:
153161 # Iterate over the list of required files:
154162 for file in "${required_files[@]}"; do
155163 # Check whether the file is present in the pull request:
156- if [[ ! "${{ steps.changed -files.outputs.added_files }}" =~ "${file}" ]]; then
164+ if [[ ! "${{ steps.added -files.outputs.files }}" =~ "${file}" ]]; then
157165 # If not, add the file to the list of missing files:
158166 missing_files+=("${file}")
159167
0 commit comments