Skip to content

Commit 54d7be2

Browse files
committed
update workflow, using github cli with auto-pagination, to pull in ALL changes in PR
1 parent f2fc14c commit 54d7be2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/pr.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818

1919
- name: Run tests for changed/added exercises
2020
run: |
21-
PULL_REQUEST_URL=$(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH")
22-
curl --silent --url $"${PULL_REQUEST_URL}/files" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | \
23-
jq -c '.[] | select(.status == "added" or .status == "modified") | select(.filename | match("\\.(md|sh)$")) | .filename' | \
24-
xargs -r bash .github/scripts/pr
21+
pr_endpoint=$(jq -r '"repos/\(.repository.full_name)/pulls/\(.pull_request.number)"' "$GITHUB_EVENT_PATH")
22+
gh api "$pr_endpoint/files" --paginate --jq '
23+
.[] |
24+
select(.status == "added" or .status == "modified") |
25+
select(.filename | match("\\.(md|sh)$")) |
26+
.filename
27+
' | xargs -r bash .github/scripts/pr

0 commit comments

Comments
 (0)