Add a CLI interface to the upload-sarif action
This commit is contained in:
parent
bcf676e52d
commit
6d7a135fea
15 changed files with 355 additions and 89 deletions
16
src/repository.ts
Normal file
16
src/repository.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// A repository name with owner, parsed into its two parts
|
||||
export interface RepositoryNwo {
|
||||
owner: string;
|
||||
repo: string;
|
||||
}
|
||||
|
||||
export function parseRepositoryNwo(input: string): RepositoryNwo {
|
||||
const parts = input.split('/');
|
||||
if (parts.length !== 2) {
|
||||
throw new Error(`"${input}" is not a valid repository name`);
|
||||
}
|
||||
return {
|
||||
owner: parts[0],
|
||||
repo: parts[1],
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue