@@ -12,7 +12,7 @@ import * as analyses from "./analyses";
1212import * as api from "./api-client" ;
1313import { getGitHubVersion , wrapApiConfigurationError } from "./api-client" ;
1414import { CodeQL , getCodeQL } from "./codeql" ;
15- import { getConfig } from "./config-utils " ;
15+ import type { ActionConfig } from "./config/action-config " ;
1616import { readDiffRangesJsonFile } from "./diff-informed-analysis-utils" ;
1717import { ActionsEnvVars , EnvVar , exportEnvVar } from "./environment" ;
1818import { FeatureEnablement } from "./feature-flags" ;
@@ -94,15 +94,19 @@ async function shouldDisableCombineSarifFiles(
9494 return true ;
9595}
9696
97- // Takes a list of paths to sarif files and combines them together using the
98- // CLI `github merge-results` command when all SARIF files are produced by
99- // CodeQL. Otherwise, it will fall back to combining the files in the action.
100- // Returns the contents of the combined sarif file.
97+ /**
98+ * Takes a list of paths to sarif files and combines them together using the
99+ * CLI `github merge-results` command when all SARIF files are produced by
100+ * CodeQL. Otherwise, it will fall back to combining the files in the action.
101+ *
102+ * @returns The contents of the combined sarif file.
103+ */
101104async function combineSarifFilesUsingCLI (
102105 sarifFiles : string [ ] ,
103106 gitHubVersion : GitHubVersion ,
104107 features : FeatureEnablement ,
105108 logger : Logger ,
109+ config : ActionConfig < "codeQLCmd" | "tempDir" > | undefined ,
106110) : Promise < Partial < sarif . Log > > {
107111 const env = util . getEnv ( ) ;
108112
@@ -140,7 +144,6 @@ async function combineSarifFilesUsingCLI(
140144 let codeQL : CodeQL ;
141145 let tempDir : string = actionsUtil . getTemporaryDirectory ( ) ;
142146
143- const config = await getConfig ( tempDir , logger ) ;
144147 if ( config !== undefined ) {
145148 codeQL = await getCodeQL ( logger , config . codeQLCmd ) ;
146149 tempDir = config . tempDir ;
@@ -599,6 +602,7 @@ export interface PostProcessingResults {
599602export async function postProcessSarifFiles (
600603 logger : Logger ,
601604 features : FeatureEnablement ,
605+ config : ActionConfig < "codeQLCmd" | "tempDir" > | undefined ,
602606 checkoutPath : string ,
603607 sarifPaths : string [ ] ,
604608 category : string | undefined ,
@@ -623,6 +627,7 @@ export async function postProcessSarifFiles(
623627 gitHubVersion ,
624628 features ,
625629 logger ,
630+ config ,
626631 ) ;
627632 } else {
628633 const sarifPath = sarifPaths [ 0 ] ;
@@ -683,6 +688,7 @@ export async function writePostProcessedFiles(
683688 * to.
684689 */
685690export async function uploadFiles (
691+ config : ActionConfig < "codeQLCmd" | "tempDir" > | undefined ,
686692 inputSarifPath : string ,
687693 checkoutPath : string ,
688694 category : string | undefined ,
@@ -697,6 +703,7 @@ export async function uploadFiles(
697703
698704 return uploadSpecifiedFiles (
699705 sarifPaths ,
706+ config ,
700707 checkoutPath ,
701708 category ,
702709 features ,
@@ -710,6 +717,7 @@ export async function uploadFiles(
710717 */
711718async function uploadSpecifiedFiles (
712719 sarifPaths : string [ ] ,
720+ config : ActionConfig < "codeQLCmd" | "tempDir" > | undefined ,
713721 checkoutPath : string ,
714722 category : string | undefined ,
715723 features : FeatureEnablement ,
@@ -719,6 +727,7 @@ async function uploadSpecifiedFiles(
719727 const processingResults : PostProcessingResults = await postProcessSarifFiles (
720728 logger ,
721729 features ,
730+ config ,
722731 checkoutPath ,
723732 sarifPaths ,
724733 category ,
0 commit comments