Merge branch 'main' into windows_message

This commit is contained in:
Robert Brignull 2020-09-07 16:01:09 +01:00
commit c68937100c
6 changed files with 28 additions and 6 deletions

View file

@ -227,6 +227,7 @@ export async function setupCodeQL(
} else {
logger.debug('Downloading CodeQL bundle without token.');
}
logger.info(`Downloading CodeQL tools from ${codeqlURL}. This may take a while.`);
let codeqlPath = await toolcacheDownloadTool(codeqlURL, headers, tempDir, logger);
logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`);

View file

@ -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,