Store generated config file in temporary directory
This prevents it from becoming part of the analysis.
This commit is contained in:
parent
c79c360e02
commit
191f59f435
3 changed files with 5 additions and 8 deletions
4
lib/config-utils.js
generated
4
lib/config-utils.js
generated
|
|
@ -462,13 +462,13 @@ function dbLocationOrDefault(dbLocation, tempDir) {
|
||||||
*/
|
*/
|
||||||
async function initConfig(inputs) {
|
async function initConfig(inputs) {
|
||||||
let config;
|
let config;
|
||||||
const { logger, workspacePath } = inputs;
|
const { logger, tempDir } = inputs;
|
||||||
// if configInput is set, it takes precedence over configFile
|
// if configInput is set, it takes precedence over configFile
|
||||||
if (inputs.configInput) {
|
if (inputs.configInput) {
|
||||||
if (inputs.configFile) {
|
if (inputs.configFile) {
|
||||||
logger.warning(`Both a config file and config input were provided. Ignoring config file.`);
|
logger.warning(`Both a config file and config input were provided. Ignoring config file.`);
|
||||||
}
|
}
|
||||||
inputs.configFile = path.resolve(workspacePath, "user-config-from-action.yml");
|
inputs.configFile = path.resolve(tempDir, "user-config-from-action.yml");
|
||||||
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
||||||
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -813,7 +813,7 @@ function dbLocationOrDefault(
|
||||||
export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
|
export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
|
||||||
let config: Config;
|
let config: Config;
|
||||||
|
|
||||||
const { logger, workspacePath } = inputs;
|
const { logger, tempDir } = inputs;
|
||||||
|
|
||||||
// if configInput is set, it takes precedence over configFile
|
// if configInput is set, it takes precedence over configFile
|
||||||
if (inputs.configInput) {
|
if (inputs.configInput) {
|
||||||
|
|
@ -822,10 +822,7 @@ export async function initConfig(inputs: InitConfigInputs): Promise<Config> {
|
||||||
`Both a config file and config input were provided. Ignoring config file.`,
|
`Both a config file and config input were provided. Ignoring config file.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
inputs.configFile = path.resolve(
|
inputs.configFile = path.resolve(tempDir, "user-config-from-action.yml");
|
||||||
workspacePath,
|
|
||||||
"user-config-from-action.yml",
|
|
||||||
);
|
|
||||||
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
fs.writeFileSync(inputs.configFile, inputs.configInput);
|
||||||
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
logger.debug(`Using config from action input: ${inputs.configFile}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue