Don't refer to config file in contexts where it's not relevant

https://github.com/github/codeql-action/pull/127#discussion_r476366221
This commit is contained in:
Sam Partington 2020-08-25 14:19:16 +01:00
parent bdfd48264f
commit ab4e7216d3
3 changed files with 7 additions and 10 deletions

6
lib/config-utils.js generated
View file

@ -374,11 +374,11 @@ async function getLanguages() {
* Returns true if queries were provided in the workflow file
* (and thus added), otherwise false
*/
async function addQueriesFromWorkflowIfRequired(codeQL, languages, resultMap, tempDir, configFile) {
async function addQueriesFromWorkflowIfRequired(codeQL, languages, resultMap, tempDir) {
const queryUses = core.getInput('queries');
if (queryUses) {
for (const query of queryUses.split(',')) {
await parseQueryUses(languages, codeQL, resultMap, query, tempDir, configFile);
await parseQueryUses(languages, codeQL, resultMap, query, tempDir);
}
return true;
}
@ -444,7 +444,7 @@ async function loadConfig(configFile, tempDir, toolCacheDir, codeQL) {
}
// If queries were provided using `with` in the action configuration,
// they should take precedence over the queries in the config file
const addedQueriesFromAction = await addQueriesFromWorkflowIfRequired(codeQL, languages, queries, tempDir, configFile);
const addedQueriesFromAction = await addQueriesFromWorkflowIfRequired(codeQL, languages, queries, tempDir);
if (!addedQueriesFromAction && QUERIES_PROPERTY in parsedYAML) {
if (!(parsedYAML[QUERIES_PROPERTY] instanceof Array)) {
throw new Error(getQueriesInvalid(configFile));