Fix: create codeql-action diagnostics directory

This commit is contained in:
Michael B. Gale 2023-10-05 13:20:34 +01:00
parent faf7528b44
commit 7f4a9481a7
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
3 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { writeFileSync } from "fs";
import { mkdirSync, writeFileSync } from "fs";
import path from "path";
import { Config } from "./config-utils";
@ -86,6 +86,10 @@ export function addDiagnostic(config: Config, diagnostic: DiagnosticMessage) {
"diagnostic",
"codeql-action",
);
// Create the directory if it doesn't exist yet.
mkdirSync(diagnosticsPath, { recursive: true });
const jsonPath = path.resolve(
diagnosticsPath,
`codeql-action-${diagnostic.timestamp}.json`,