Skip to content

Commit d509c62

Browse files
committed
Change getGeneratedCodeScanningConfigPath to not require full Config
1 parent f2e590e commit d509c62

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/codeql.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ async function getCodeQLForCmd(
817817
"--print-metrics-summary",
818818
"--sarif-add-baseline-file-info",
819819
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
820-
config,
820+
config.tempDir,
821821
)}`,
822822
"--sarif-group-rules-by-pack",
823823
"--sarif-include-query-help=always",
@@ -928,7 +928,7 @@ async function getCodeQLForCmd(
928928
"--format=sarif-latest",
929929
`--output=${sarifFile}`,
930930
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
931-
config,
931+
config.tempDir,
932932
)}`,
933933
...(diagnosticDir !== undefined
934934
? [`--diagnostic-dir=${diagnosticDir}`]
@@ -1191,7 +1191,9 @@ async function writeCodeScanningConfigFile(
11911191
config: Config,
11921192
logger: Logger,
11931193
): Promise<string> {
1194-
const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(config);
1194+
const codeScanningConfigFile = getGeneratedCodeScanningConfigPath(
1195+
config.tempDir,
1196+
);
11951197

11961198
// Apply the `extraQueryExclusions` from the CodeQL Action state to the CLI configuration.
11971199
// We do this here at the latest possible point before passing the CLI configuration on to
@@ -1247,8 +1249,8 @@ export async function getTrapCachingExtractorConfigArgsForLang(
12471249
*
12481250
* This will not exist if the configuration is being parsed in the Action.
12491251
*/
1250-
function getGeneratedCodeScanningConfigPath(config: Config): string {
1251-
return path.resolve(config.tempDir, "user-config.yaml");
1252+
function getGeneratedCodeScanningConfigPath(tempDir: string): string {
1253+
return path.resolve(tempDir, "user-config.yaml");
12521254
}
12531255

12541256
function getExtractionVerbosityArguments(

0 commit comments

Comments
 (0)