@@ -328,17 +328,20 @@ async function getPackageInfosEtc(
328
328
let result : PackageInfo [ ] = [ ] , maxDownloads = 0 ;
329
329
for ( const [ name , files ] of infos ) {
330
330
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
332
333
: ! paths . includes ( `types/${ name } /index.d.ts` ) ? oldOwners
333
334
: 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" ;
336
339
const owners = oldOwners || [ ] ;
337
- const addedOwners = newOwners === null || newOwners instanceof Error ? [ ]
340
+ const addedOwners = newOwners === null ? [ ]
338
341
: oldOwners === null ? newOwners
339
342
: newOwners . filter ( o => ! oldOwners . includes ( o ) ) ;
340
343
const deletedOwners = oldOwners === null ? [ ]
341
- : newOwners === null || newOwners instanceof Error ? oldOwners
344
+ : newOwners === null ? oldOwners
342
345
: oldOwners . filter ( o => ! newOwners . includes ( o ) ) ;
343
346
// null name => infra => ensure critical (even though it's unused atm)
344
347
const downloads = name ? await getDownloads ( name ) : Infinity ;
0 commit comments