fix after review from @henrymercer

This commit is contained in:
tgrall 2023-04-18 05:43:21 +02:00
parent fc374f5e9a
commit f398a65921
7 changed files with 39 additions and 37 deletions

View file

@ -925,9 +925,9 @@ test("Queries in workflow file can be added to the set of queries without overri
});
});
test("Queries can be specified in configuration, same as file", async (t) => {
test("Queries can be specified using config input", async (t) => {
return await util.withTmpDir(async (tmpDir) => {
const inputFileContents = `
const configInput = `
name: my config
queries:
- uses: ./foo
@ -967,7 +967,7 @@ test("Queries can be specified in configuration, same as file", async (t) => {
undefined,
undefined,
undefined,
inputFileContents,
configInput,
false,
false,
"",

View file

@ -1708,6 +1708,11 @@ export async function initConfig(
// if configInput is set, it takes precedence over configFile
if (configInput) {
if (configFile) {
logger.warning(
`Both a config file and config input were provided. Ignoring config file.`
);
}
configFile = path.resolve(workspacePath, "user-config-from-action.yml");
fs.writeFileSync(configFile, configInput);
logger.debug(`Using config from action input: ${configFile}`);