Skip to content

Commit 6f3f0ab

Browse files
TMHSDigitalclaude
andcommitted
ci(labels): list PR files via the files API, not the full diff
gh pr diff --name-only downloads the whole diff first and fails with HTTP 406 past 20,000 lines; a full docs/gallery regeneration crossed that on #300 and left the PR red on a check that only needed file paths. The paginated files endpoint returns paths alone and has no diff-size limit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 2b51d1f commit 6f3f0ab

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/label-sync.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ jobs:
1919
id: changed
2020
env:
2121
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
# The files endpoint lists paths only. `gh pr diff --name-only` fetches the
23+
# whole diff first and fails with HTTP 406 past 20,000 lines, which a
24+
# full docs/gallery regeneration exceeds (#300).
2225
run: |
23-
FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only)
26+
FILES=$(gh api --paginate "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --jq '.[].filename')
2427
echo "files<<EOF" >> "$GITHUB_OUTPUT"
2528
echo "$FILES" >> "$GITHUB_OUTPUT"
2629
echo "EOF" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)