File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ async function main() {
5858 if ( ! args . enterprise && ! args . org && ! args . repo ) throw new Error ( "Provide --enterprise, --org or --repo with --sync-sboms" ) ;
5959 if ( args . enterprise && args . org ) throw new Error ( "Specify only one of --enterprise or --org" ) ;
6060 if ( args . repo && ( args . enterprise || args . org ) ) throw new Error ( "Specify only one of --enterprise, --org, or --repo" ) ;
61+ if ( args . repo && ! ( args . repo as string ) . includes ( "/" ) ) throw new Error ( "--repo must be in the format owner/repo" ) ;
6162 if ( syncing && ! args . sbomCache ) throw new Error ( "--sync-sboms requires --sbom-cache to write updated SBOMs to disk" ) ;
6263 } else {
6364 const malwareOnly = ! ! args [ "sync-malware" ] && ! args . sbomCache && ! args . purl && ! args [ "purl-file" ] && ! args [ "match-malware" ] && ! args . uploadSarif && ! args . interactive ;
Original file line number Diff line number Diff line change @@ -349,7 +349,11 @@ export class SbomCollector {
349349 renderBar ( ) ;
350350 } ) ) ;
351351 await Promise . all ( tasks ) ;
352- newSboms = newSboms . filter ( s => repoNames . has ( s . repo ) || repoNames . has ( s . repo . split ( "/" ) [ 1 ] ) ) ;
352+
353+ newSboms = newSboms . filter ( s => {
354+ const repoToCheck = s . repo . includes ( "/" ) ? s . repo . split ( "/" ) [ 1 ] : s . repo ;
355+ return repoNames . has ( repoToCheck ) ;
356+ } ) ;
353357 this . sboms . push ( ...newSboms ) ;
354358 }
355359 if ( this . opts . showProgressBar ) process . stdout . write ( "\n" ) ;
You can’t perform that action at this time.
0 commit comments