File tree Expand file tree Collapse file tree 4 files changed +49
-10
lines changed Expand file tree Collapse file tree 4 files changed +49
-10
lines changed Original file line number Diff line number Diff line change 24
24
jobs :
25
25
gcc-openmp :
26
26
runs-on : [self-hosted, ghci-snl-cpu, gcc]
27
- name : gcc-openmp / cov
27
+ name : gcc-openmp / valg
28
28
steps :
29
29
- name : Check out the repository
30
30
uses : actions/checkout@v4
Original file line number Diff line number Diff line change 67
67
pattern=$(IFS=\|; echo "${paths[*]}")
68
68
69
69
# Use the GitHub API to get the list of changed files
70
- response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
71
- "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
72
- changed_files=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')
70
+ # There are page size limits, so do it in chunks
71
+ page=1
72
+ while true; do
73
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
74
+ "https://api.github.com/repos/E3SM-Project/scream/pulls/${{ github.event.number }}/files?per_page=100&page=$page")
75
+
76
+ # Check if the response is empty, and break if it is
77
+ [ -z "$response" ] && break
78
+
79
+ changed_files+=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')$'\n'
80
+
81
+ # Check if there are more pages, and quite if there aren't
82
+ [[ $(echo "$response" | jq '. | length') -lt 100 ]] && break
83
+
84
+ page=$((page + 1))
85
+ done
73
86
74
87
# Check for matches and echo the matching files (or "" if none)
75
88
matching_files=$(echo "$changed_files" | grep -E "^($pattern)" || echo "")
Original file line number Diff line number Diff line change 50
50
pattern=$(IFS=\|; echo "${paths[*]}")
51
51
52
52
# Use the GitHub API to get the list of changed files
53
- response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
54
- "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
55
- changed_files=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')
53
+ # There are page size limits, so do it in chunks
54
+ page=1
55
+ while true; do
56
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
57
+ "https://api.github.com/repos/E3SM-Project/scream/pulls/${{ github.event.number }}/files?per_page=100&page=$page")
58
+
59
+ # Check if the response is empty, and break if it is
60
+ [ -z "$response" ] && break
61
+
62
+ changed_files+=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')$'\n'
63
+
64
+ # Check if there are more pages, and quite if there aren't
65
+ [[ $(echo "$response" | jq '. | length') -lt 100 ]] && break
66
+
67
+ page=$((page + 1))
68
+ done
56
69
57
70
# Check for matches and echo the matching files (or "" if none)
58
71
matching_files=$(echo "$changed_files" | grep -E "^($pattern)" || echo "")
Original file line number Diff line number Diff line change 54
54
pattern=$(IFS=\|; echo "${paths[*]}")
55
55
56
56
# Use the GitHub API to get the list of changed files
57
- response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
58
- "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
59
- changed_files=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')
57
+ # There are page size limits, so do it in chunks
58
+ page=1
59
+ while true; do
60
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
61
+ "https://api.github.com/repos/E3SM-Project/scream/pulls/${{ github.event.number }}/files?per_page=100&page=$page")
62
+
63
+ # Check if the response is empty, and break if it is
64
+ [ -z "$response" ] && break
65
+
66
+ changed_files+=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')$'\n'
67
+
68
+ # Check if there are more pages, and quite if there aren't
69
+ [[ $(echo "$response" | jq '. | length') -lt 100 ]] && break
70
+
71
+ page=$((page + 1))
72
+ done
60
73
61
74
# Check for matches and echo the matching files (or "" if none)
62
75
matching_files=$(echo "$changed_files" | grep -E "^($pattern)" || echo "")
You can’t perform that action at this time.
0 commit comments