diff --git a/CHANGELOG.md b/CHANGELOG.md index e66e4d347d..00814f6231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the ## [UNRELEASED] -No user facing changes. +- Fix an issue where the CodeQL Action could not write diagnostic messages on Windows. This issue did not impact analysis quality. [#2430](https://github.com/github/codeql-action/pull/2430) ## 3.26.2 - 14 Aug 2024 diff --git a/lib/diagnostics.js b/lib/diagnostics.js index 4743424e96..a8d3ccd055 100644 --- a/lib/diagnostics.js +++ b/lib/diagnostics.js @@ -67,7 +67,9 @@ function writeDiagnostic(config, language, diagnostic) { try { // Create the directory if it doesn't exist yet. (0, fs_1.mkdirSync)(diagnosticsPath, { recursive: true }); - const jsonPath = path_1.default.resolve(diagnosticsPath, `codeql-action-${diagnostic.timestamp}.json`); + const jsonPath = path_1.default.resolve(diagnosticsPath, + // Remove colons from the timestamp as these are not allowed in Windows filenames. + `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.json`); (0, fs_1.writeFileSync)(jsonPath, JSON.stringify(diagnostic)); } catch (err) { diff --git a/lib/diagnostics.js.map b/lib/diagnostics.js.map index bee7607358..ad057d1f55 100644 --- a/lib/diagnostics.js.map +++ b/lib/diagnostics.js.map @@ -1 +1 @@ -{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":";;;;;AA4EA,wCAUC;AAUD,sCAqBC;AAyCD,0DAYC;AAGD,4CAYC;AAzLD,2BAA0D;AAC1D,gDAAwB;AAIxB,uCAA6C;AAC7C,iCAA+C;AA2D/C,qEAAqE;AACrE,IAAI,oBAAoB,GAA0B,EAAE,CAAC;AAErD;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,EAAU,EACV,IAAY,EACZ,OAA+C,SAAS;IAExD,OAAO;QACL,GAAG,IAAI;QACP,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW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c;IAC7C,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,MAAM,CAAC,KAAK,CACV,WAAW,oBAAoB,CAAC,MAAM,6BAA6B,CACpE,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,oBAAoB,EAAE,CAAC;QAC7C,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IAED,yCAAyC;IACzC,oBAAoB,GAAG,EAAE,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/src/diagnostics.ts b/src/diagnostics.ts index b8c840c3e1..b3d18b23cb 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -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));