Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit a88fa15

Browse files
committed
Minor tweaks to the owners revisions
1 parent 21ce809 commit a88fa15

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/pr-info.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,20 @@ async function getPackageInfosEtc(
328328
let result: PackageInfo[] = [], maxDownloads = 0;
329329
for (const [name, files] of infos) {
330330
const oldOwners = !name ? null : await getOwnersOfPackage(name, "master", fetchFile);
331-
const newOwners = !name ? null
331+
if (oldOwners instanceof Error) return oldOwners;
332+
const newOwners0 = !name ? null
332333
: !paths.includes(`types/${name}/index.d.ts`) ? oldOwners
333334
: await getOwnersOfPackage(name, headId, fetchFile);
334-
if (oldOwners instanceof Error) return oldOwners;
335-
const kind = !name ? "edit" : oldOwners ? newOwners ? "edit" : "delete" : "add";
335+
// treats a header error as a missing file, the CI will fail anyway
336+
// (maybe add a way to pass the error in the info so people don't need to read the CI?)
337+
const newOwners = newOwners0 instanceof Error ? null : newOwners0;
338+
const kind = !name ? "edit" : !oldOwners ? "add" : !newOwners ? "delete" : "edit";
336339
const owners = oldOwners || [];
337-
const addedOwners = newOwners === null || newOwners instanceof Error ? []
340+
const addedOwners = newOwners === null ? []
338341
: oldOwners === null ? newOwners
339342
: newOwners.filter(o => !oldOwners.includes(o));
340343
const deletedOwners = oldOwners === null ? []
341-
: newOwners === null || newOwners instanceof Error ? oldOwners
344+
: newOwners === null ? oldOwners
342345
: oldOwners.filter(o => !newOwners.includes(o));
343346
// null name => infra => ensure critical (even though it's unused atm)
344347
const downloads = name ? await getDownloads(name) : Infinity;

0 commit comments

Comments
 (0)