Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/src/repository.ts
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Robert Brignull
Add a CLI interface to the upload-sarif action
16 lines (15 sloc)
386 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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], | |
}; | |
} |