Fix writing diagnostics on Windows

Remove colons from the generated filename so it is valid on Windows.
This commit is contained in:
Henry Mercer 2024-08-19 16:42:48 +01:00
parent 5c681efc3f
commit e5a65875f9
3 changed files with 6 additions and 3 deletions

View file

@ -145,7 +145,8 @@ function writeDiagnostic(
const jsonPath = path.resolve(
diagnosticsPath,
`codeql-action-${diagnostic.timestamp}.json`,
// Remove colons from the timestamp as these are not allowed in Windows filenames.
`codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json`,
);
writeFileSync(jsonPath, JSON.stringify(diagnostic));