Apply suggestions from code review

Co-authored-by: Henry Mercer <henry.mercer@me.com>
This commit is contained in:
Andrew Eisenberg 2023-02-09 11:19:27 -08:00
parent e2f72f11e4
commit 3c81243bb1
15 changed files with 130 additions and 91 deletions

7
lib/init.js generated
View file

@ -61,9 +61,10 @@ async function runInit(codeql, config, sourceRoot, processName, registriesInput,
fs.mkdirSync(config.dbLocation, { recursive: true });
try {
if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
// Only create the qlconfig file if we haven't already created it.
// If we are not parsing the config file in the cli, then the qlconfig
// file has already been created.
// When parsing the codeql config in the CLI, we have not yet created the qlconfig file.
// So, create it now.
// If we are parsing the config file in the Action, then the qlconfig file was already created
// before the `pack download` command was invoked. It is not required for the init command.
let registriesAuthTokens;
let qlconfigFile;
if (await util.useCodeScanningConfigInCli(codeql, featureEnablement)) {