Skip to content

Commit

Permalink
Showing 3 changed files with 25 additions and 5 deletions.
14 changes: 12 additions & 2 deletions lib/runner.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/runner.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/runner.ts
@@ -66,6 +66,16 @@ function importTracerEnvironment(config: Config) {
}
}

// Allow the user to specify refs in full refs/heads/branch format
// or just the short branch name and prepend "refs/heads/" to it.
function parseRef(userInput: string): string {
if (userInput.startsWith('refs/')) {
return userInput;
} else {
return 'refs/heads/' + userInput;
}
}

interface InitArgs {
languages: string | undefined;
queries: string | undefined;
@@ -265,7 +275,7 @@ program
await runAnalyze(
parseRepositoryNwo(cmd.repository),
cmd.commit,
cmd.ref,
parseRef(cmd.ref),
undefined,
undefined,
undefined,
@@ -316,7 +326,7 @@ program
cmd.sarifFile,
parseRepositoryNwo(cmd.repository),
cmd.commit,
cmd.ref,
parseRef(cmd.ref),
undefined,
undefined,
undefined,

0 comments on commit 1a772a2

Please sign in to comment.