resolve comments from @henrymercer

This commit is contained in:
tgrall 2023-04-10 07:56:09 +02:00
parent 0b75f471b1
commit b4e6f81a72
9 changed files with 21 additions and 25 deletions

11
lib/config-utils.js generated
View file

@ -932,13 +932,12 @@ function dbLocationOrDefault(dbLocation, tempDir) {
* This will parse the config from the user input if present, or generate
* a default config. The parsed config is then stored to a known location.
*/
async function initConfig(languagesInput, queriesInput, packsInput, registriesInput, configFile, dbLocation, configAsParameter, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger) {
async function initConfig(languagesInput, queriesInput, packsInput, registriesInput, configFile, dbLocation, configInput, trapCachingEnabled, debugMode, debugArtifactName, debugDatabaseName, repository, tempDir, codeQL, workspacePath, gitHubVersion, apiDetails, features, logger) {
let config;
// if configAsParameter is set, it takes precedence over configFile
if (configAsParameter) {
const configFileToCreate = path.resolve(workspacePath, "user-config-from-action.yml");
fs.writeFileSync(configFileToCreate, configAsParameter);
configFile = configFileToCreate;
// if configInput is set, it takes precedence over configFile
if (configInput) {
configFile = path.resolve(workspacePath, "user-config-from-action.yml");
fs.writeFileSync(configFile, configInput);
logger.debug(`Using config from action input: ${configFile}`);
}
// If no config file was provided create an empty one