mirror of
https://github.com/github/codeql-action.git
synced 2026-10-29 17:17:15 +00:00
Fix flushDiagnostics not ensuring directories exist
This commit is contained in:
13
lib/entry-points.js
generated
13
lib/entry-points.js
generated
@@ -173070,6 +173070,7 @@ function flushDiagnostics(action, config) {
|
||||
action.logger.debug(
|
||||
`Moving ${diagnosticsCount} diagnostic(s) to their respective databases.`
|
||||
);
|
||||
const failedFlushDiagnostics = [];
|
||||
for (const temporary of temporaryDiagnostics) {
|
||||
const directory = getDatabaseDiagnosticsPath(
|
||||
config,
|
||||
@@ -173077,9 +173078,17 @@ function flushDiagnostics(action, config) {
|
||||
);
|
||||
const filename = import_path2.default.basename(temporary.path);
|
||||
const destination = import_path2.default.join(directory, filename);
|
||||
action.fs.renameSync(temporary.path, destination);
|
||||
try {
|
||||
action.fs.mkdirSync(directory, { recursive: true });
|
||||
action.fs.renameSync(temporary.path, destination);
|
||||
} catch (err) {
|
||||
action.logger.warning(
|
||||
`Failed to rename '${temporary.path}' to '${destination}': ${getErrorMessage(err)}`
|
||||
);
|
||||
failedFlushDiagnostics.push(temporary);
|
||||
}
|
||||
}
|
||||
temporaryDiagnostics = [];
|
||||
temporaryDiagnostics = failedFlushDiagnostics;
|
||||
}
|
||||
function makeTelemetryDiagnostic(id, name, attributes, tags) {
|
||||
return makeDiagnostic(id, name, {
|
||||
|
||||
Reference in New Issue
Block a user