mirror of
https://github.com/github/codeql-action.git
synced 2025-12-29 02:30:11 +08:00
Make code that builds the list of queries for run-queries more robust in the event of future changes
This commit is contained in:
@@ -675,18 +675,17 @@ export async function runQueries(
|
||||
// the database was initialised.
|
||||
const queries: string[] = [];
|
||||
|
||||
// If both Code Scanning and Code Quality analyses are enabled, the database
|
||||
// is initialised for Code Scanning. To avoid duplicate work, we want to run
|
||||
// queries for both analyses at the same time. To do this, we invoke `run-queries`
|
||||
// once with the generated query suite for Code Scanning + the fixed
|
||||
// query suite for Code Quality.
|
||||
if (
|
||||
configUtils.isCodeQualityEnabled(config) &&
|
||||
configUtils.isCodeScanningEnabled(config)
|
||||
) {
|
||||
// If multiple analysis kinds are enabled, the database is initialised for Code Scanning.
|
||||
// To avoid duplicate work, we want to run queries for all analyses at the same time.
|
||||
// To do this, we invoke `run-queries` once with the generated query suite that was created
|
||||
// when the database was initialised + the queries for other analysis kinds.
|
||||
if (config.analysisKinds.length > 1) {
|
||||
queries.push(util.getGeneratedSuitePath(config, language));
|
||||
for (const qualityQuery of analyses.codeQualityQueries) {
|
||||
queries.push(resolveQuerySuiteAlias(language, qualityQuery));
|
||||
|
||||
if (configUtils.isCodeQualityEnabled(config)) {
|
||||
for (const qualityQuery of analyses.codeQualityQueries) {
|
||||
queries.push(resolveQuerySuiteAlias(language, qualityQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user