Skip to content

Commit 43d9bc8

Browse files
committed
Only specify queries for run-queries if both analysis kinds are enabled
1 parent 14f41bd commit 43d9bc8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/analyze-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,19 @@ export async function runQueries(
661661
try {
662662
const sarifFile = path.join(sarifFolder, `${language}.sarif`);
663663

664+
// This should be empty to run only the query suite that was generated when
665+
// the database was initialised.
664666
const queries: string[] = [];
665-
if (configUtils.isCodeQualityEnabled(config)) {
667+
668+
// If both Code Scanning and Code Quality analyses are enabled, the database
669+
// is initialised for Code Scanning. To avoid duplicate work, we want to run
670+
// queries for both analyses at the same time. To do this, we invoke `run-queries`
671+
// once with the generated query suite for Code Scanning + the fixed
672+
// query suite for Code Quality.
673+
if (
674+
configUtils.isCodeQualityEnabled(config) &&
675+
configUtils.isCodeScanningEnabled(config)
676+
) {
666677
queries.push(util.getGeneratedSuitePath(config, language));
667678
for (const qualityQuery of config.augmentationProperties
668679
.qualityQueriesInput) {

0 commit comments

Comments
 (0)