[ci] Fall back to files API when PR diff exceeds GitHub line limit (#18486)

This commit is contained in:
Jonathan Swoboda
2026-08-18 10:22:28 -04:00
committed by GitHub
parent ae730d6357
commit 476d540065
2 changed files with 41 additions and 2 deletions
+3 -2
View File
@@ -558,8 +558,9 @@ def _get_changed_files_github_actions() -> list[str] | None:
try:
return _get_changed_files_from_command(cmd)
except Exception as e:
# If it fails due to the 300 file limit, use the API method
if "maximum" in str(e) and "files" in str(e):
# If it fails due to a diff limit (300 files or 20000 lines),
# use the API method which only returns filenames
if "diff exceeded the maximum" in str(e):
cmd = [
"gh",
"api",