@@ -608,6 +608,16 @@ export function resolveQuerySuiteAlias(
608608 return maybeSuite ;
609609}
610610
611+ /**
612+ * Adds the appropriate file extension for the given analysis configuration to the given base filename.
613+ */
614+ export function addSarifExtension (
615+ analysis : analyses . AnalysisConfig ,
616+ base : string ,
617+ ) : string {
618+ return `${ base } .${ analysis . sarifExtension } ` ;
619+ }
620+
611621// Runs queries and creates sarif files in the given folder
612622export async function runQueries (
613623 sarifFolder : string ,
@@ -658,13 +668,16 @@ export async function runQueries(
658668 ? `--sarif-run-property=incrementalMode=${ incrementalMode . join ( "," ) } `
659669 : undefined ;
660670
671+ const dbAnalysisConfig = configUtils . getDbAnalysisConfig ( config ) ;
672+
661673 for ( const language of config . languages ) {
662674 try {
663675 // If Code Scanning is enabled, then the main SARIF file is always the Code Scanning one.
664676 // Otherwise, only Code Quality is enabled, and the main SARIF file is the Code Quality one.
665- const sarifFile = configUtils . isCodeScanningEnabled ( config )
666- ? path . join ( sarifFolder , `${ language } .sarif` )
667- : path . join ( sarifFolder , `${ language } .quality.sarif` ) ;
677+ const sarifFile = path . join (
678+ sarifFolder ,
679+ addSarifExtension ( dbAnalysisConfig , language ) ,
680+ ) ;
668681
669682 // This should be empty to run only the query suite that was generated when
670683 // the database was initialised.
@@ -709,7 +722,9 @@ export async function runQueries(
709722 configUtils . isCodeScanningEnabled ( config ) ||
710723 configUtils . isCodeQualityEnabled ( config )
711724 ) {
712- logger . startGroup ( `Interpreting results for ${ language } ` ) ;
725+ logger . startGroup (
726+ `Interpreting ${ dbAnalysisConfig . name } results for ${ language } ` ,
727+ ) ;
713728
714729 // If this is a Code Quality analysis, correct the category to one
715730 // accepted by the Code Quality backend.
@@ -736,14 +751,16 @@ export async function runQueries(
736751 configUtils . isCodeQualityEnabled ( config ) &&
737752 configUtils . isCodeScanningEnabled ( config )
738753 ) {
739- logger . info ( `Interpreting quality results for ${ language } ` ) ;
754+ logger . info (
755+ `Interpreting ${ analyses . CodeQuality . name } results for ${ language } ` ,
756+ ) ;
740757 const qualityCategory = fixCodeQualityCategory (
741758 logger ,
742759 automationDetailsId ,
743760 ) ;
744761 const qualitySarifFile = path . join (
745762 sarifFolder ,
746- ` ${ language } .quality.sarif` ,
763+ addSarifExtension ( analyses . CodeQuality , language ) ,
747764 ) ;
748765 qualityAnalysisSummary = await runInterpretResults (
749766 language ,
0 commit comments