mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 10:11:28 +00:00
Change diagnosticsExport to not require full Config
This commit is contained in:
11
lib/entry-points.js
generated
11
lib/entry-points.js
generated
@@ -177334,14 +177334,14 @@ async function getCodeQLForCmd(logger2, cmd, checkVersion, env = getEnv()) {
|
||||
}
|
||||
await new toolrunner3.ToolRunner(cmd, args).exec();
|
||||
},
|
||||
async diagnosticsExport(sarifFile, automationDetailsId, config, diagnosticDir) {
|
||||
async diagnosticsExport(sarifFile, automationDetailsId, tempDir, diagnosticDir) {
|
||||
const args = [
|
||||
"diagnostics",
|
||||
"export",
|
||||
"--format=sarif-latest",
|
||||
`--output=${sarifFile}`,
|
||||
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
|
||||
config.tempDir
|
||||
tempDir
|
||||
)}`,
|
||||
...diagnosticDir !== void 0 ? [`--diagnostic-dir=${diagnosticDir}`] : [],
|
||||
...getExtraOptionsFromEnv(["diagnostics", "export"])
|
||||
@@ -186904,7 +186904,12 @@ async function generateFailedSarif(logger2, features, config, category, checkout
|
||||
if (!fs31.existsSync(diagnosticDir)) {
|
||||
diagnosticDir = void 0;
|
||||
}
|
||||
await codeql.diagnosticsExport(sarifFile, category, config, diagnosticDir);
|
||||
await codeql.diagnosticsExport(
|
||||
sarifFile,
|
||||
category,
|
||||
config.tempDir,
|
||||
diagnosticDir
|
||||
);
|
||||
} else {
|
||||
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ export interface CodeQL {
|
||||
diagnosticsExport(
|
||||
sarifFile: string,
|
||||
automationDetailsId: string | undefined,
|
||||
config: Config,
|
||||
tempDir: string,
|
||||
diagnosticDir: string | undefined,
|
||||
): Promise<void>;
|
||||
/** Get the location of an extractor for the specified language. */
|
||||
@@ -919,7 +919,7 @@ async function getCodeQLForCmd(
|
||||
async diagnosticsExport(
|
||||
sarifFile: string,
|
||||
automationDetailsId: string | undefined,
|
||||
config: Config,
|
||||
tempDir: string,
|
||||
diagnosticDir: string | undefined,
|
||||
): Promise<void> {
|
||||
const args = [
|
||||
@@ -928,7 +928,7 @@ async function getCodeQLForCmd(
|
||||
"--format=sarif-latest",
|
||||
`--output=${sarifFile}`,
|
||||
`--sarif-codescanning-config=${getGeneratedCodeScanningConfigPath(
|
||||
config.tempDir,
|
||||
tempDir,
|
||||
)}`,
|
||||
...(diagnosticDir !== undefined
|
||||
? [`--diagnostic-dir=${diagnosticDir}`]
|
||||
|
||||
@@ -786,7 +786,7 @@ async function testFailedSarifUpload(
|
||||
diagnosticsExportStub.calledOnceWith(
|
||||
sinon.match.string,
|
||||
category,
|
||||
config,
|
||||
config.tempDir,
|
||||
),
|
||||
`Actual args were: ${JSON.stringify(diagnosticsExportStub.args)}`,
|
||||
);
|
||||
@@ -893,7 +893,7 @@ test.serial(
|
||||
diagnosticsExport.calledOnceWith(
|
||||
sinon.match(expectedFilePattern),
|
||||
"/language:javascript",
|
||||
config,
|
||||
config.tempDir,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -191,7 +191,12 @@ async function generateFailedSarif(
|
||||
diagnosticDir = undefined;
|
||||
}
|
||||
|
||||
await codeql.diagnosticsExport(sarifFile, category, config, diagnosticDir);
|
||||
await codeql.diagnosticsExport(
|
||||
sarifFile,
|
||||
category,
|
||||
config.tempDir,
|
||||
diagnosticDir,
|
||||
);
|
||||
} else {
|
||||
// We call 'database export-diagnostics' to find any per-database diagnostics.
|
||||
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
|
||||
|
||||
Reference in New Issue
Block a user