Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 468cded

Browse files
authored
Merge pull request #28 from github/noqueries
Do not launch all if no changed query
2 parents cc335d8 + 5a176e8 commit 468cded

File tree

1 file changed

+3
-7
lines changed
  • codeql-learninglab-check/package/src

1 file changed

+3
-7
lines changed

codeql-learninglab-check/package/src/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,8 @@ function isConfig(config: any): config is Config {
141141
* the first time, and so there is no "previous ref"), then comparing this
142142
* branch to the default branch of a repo will probably give the most
143143
* accurate results.
144-
* 4. Finally, if all else fails (e.g. the push was the initial push to the
145-
* default branch of the repo), then we should just run every query we
146-
* recognize (as if RUN_ALL was true). We do this by setting
147-
* unableToGetChangedQueries to true.
148-
* 5. In this last case, if there is no changed query in the repo
149-
* then it means that this is just the course creation first workflow trigger.
144+
* 4. Finally, if all else fails we set unableToGetChangedQueries to true.
145+
* It means that this is just the course creation first workflow trigger.
150146
*/
151147

152148
/*
@@ -278,7 +274,7 @@ function isConfig(config: any): config is Config {
278274
for (const query of Object.keys(config.expectedResults)) {
279275
const exists = await access(query, fs.constants.R_OK).then(() => true, () => false);
280276
// Run the query if either it's changed, or runAll is true
281-
if (exists && (RUN_ALL || unableToGetChangedQueries || queriesChanged.has(query)) || (QUERY_PATTERN && QUERY_PATTERN.test(query))) {
277+
if (exists && (RUN_ALL || queriesChanged.has(query)) || (QUERY_PATTERN && QUERY_PATTERN.test(query))) {
282278
queriesToRun.push(query);
283279
}
284280
}

0 commit comments

Comments
 (0)