Skip to content

Commit

Permalink
Fix writing diagnostics on Windows
Browse files Browse the repository at this point in the history
Remove colons from the generated filename so it is valid on Windows.
  • Loading branch information
henrymercer committed Aug 19, 2024
1 parent 5c681ef commit e5a6587
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/diagnostics.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/diagnostics.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e5a6587

Please sign in to comment.