Skip to content

Commit fe7e217

Browse files
committed
fix(ci): treat a timed-out PR file list like a refused one
#181 caught 422 ("diff is taking too long to generate"); PR #184 got a plain 504 instead and triage died again. Both mean the same thing: no file list for an oversized PR. Refs #1
1 parent bf20d19 commit fe7e217

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎.github/workflows/pr-metadata.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ jobs:
4040
pull_number: issue_number,
4141
per_page: 100,
4242
});
43-
// GitHub refuses the file list for very large PRs (dump refreshes:
44-
// 422 "diff is taking too long to generate"); label from what we got.
43+
// GitHub cannot produce the file list for very large PRs (dump
44+
// refreshes): 422 "diff is taking too long to generate", or a plain
45+
// 504 when it gives up later. Label from whatever arrived.
46+
const NO_FILE_LIST = new Set([422, 502, 503, 504]);
4547
try {
4648
for await (const { data } of fileIterator) {
4749
files.push(...data);
4850
if (files.length >= FILE_SCAN_LIMIT) break;
4951
}
5052
} catch (error) {
51-
if (error.status !== 422) throw error;
53+
if (!NO_FILE_LIST.has(error.status)) throw error;
5254
core.warning(`PR file list unavailable (${error.message}); path labels skipped`);
5355
}
5456
const filesWereCapped = (pr.changed_files || files.length) > files.length;

0 commit comments

Comments
 (0)