@@ -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 ,
@@ -650,13 +660,16 @@ export async function runQueries(
650660 ? `--sarif-run-property=incrementalMode=${ incrementalMode . join ( "," ) } `
651661 : undefined ;
652662
663+ const dbAnalysisConfig = configUtils . getDbAnalysisConfig ( config ) ;
664+
653665 for ( const language of config . languages ) {
654666 try {
655667 // If Code Scanning is enabled, then the main SARIF file is always the Code Scanning one.
656668 // Otherwise, only Code Quality is enabled, and the main SARIF file is the Code Quality one.
657- const sarifFile = configUtils . isCodeScanningEnabled ( config )
658- ? path . join ( sarifFolder , `${ language } .sarif` )
659- : path . join ( sarifFolder , `${ language } .quality.sarif` ) ;
669+ const sarifFile = path . join (
670+ sarifFolder ,
671+ addSarifExtension ( dbAnalysisConfig , language ) ,
672+ ) ;
660673
661674 // This should be empty to run only the query suite that was generated when
662675 // the database was initialised.
@@ -701,7 +714,9 @@ export async function runQueries(
701714 configUtils . isCodeScanningEnabled ( config ) ||
702715 configUtils . isCodeQualityEnabled ( config )
703716 ) {
704- logger . startGroup ( `Interpreting results for ${ language } ` ) ;
717+ logger . startGroup (
718+ `Interpreting ${ dbAnalysisConfig . name } results for ${ language } ` ,
719+ ) ;
705720
706721 // If this is a Code Quality analysis, correct the category to one
707722 // accepted by the Code Quality backend.
@@ -728,14 +743,16 @@ export async function runQueries(
728743 configUtils . isCodeQualityEnabled ( config ) &&
729744 configUtils . isCodeScanningEnabled ( config )
730745 ) {
731- logger . info ( `Interpreting quality results for ${ language } ` ) ;
746+ logger . info (
747+ `Interpreting ${ analyses . CodeQuality . name } results for ${ language } ` ,
748+ ) ;
732749 const qualityCategory = fixCodeQualityCategory (
733750 logger ,
734751 automationDetailsId ,
735752 ) ;
736753 const qualitySarifFile = path . join (
737754 sarifFolder ,
738- ` ${ language } .quality.sarif` ,
755+ addSarifExtension ( analyses . CodeQuality , language ) ,
739756 ) ;
740757 qualityAnalysisSummary = await runInterpretResults (
741758 language ,
0 commit comments