Use temporary diagnostic dir in generateFailedSarif

This commit is contained in:
Michael B. Gale
2026-10-09 22:40:36 +01:00
parent 78ebd22fd6
commit a3e8512735
4 changed files with 83 additions and 4 deletions

View File

@@ -199,6 +199,7 @@ export interface CodeQL {
sarifFile: string,
automationDetailsId: string | undefined,
config: ActionConfig<"tempDir">,
diagnosticDir: string | undefined,
): Promise<void>;
/** Get the location of an extractor for the specified language. */
resolveExtractor(language: Language): Promise<string>;
@@ -915,6 +916,7 @@ async function getCodeQLForCmd(
sarifFile: string,
automationDetailsId: string | undefined,
config: ActionConfig<"tempDir">,
diagnosticDir: string | undefined,
): Promise<void> {
const args = [
"diagnostics",
@@ -924,6 +926,9 @@ async function getCodeQLForCmd(
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
config,
)}`,
...(diagnosticDir !== undefined
? [`--diagnostic-dir=${diagnosticDir}`]
: []),
...getExtraOptionsFromEnv(["diagnostics", "export"]),
];
if (automationDetailsId !== undefined) {