mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 01:49:43 +00:00
Cleanup CodeQL DBs and output their location for later steps
This commit is contained in:
committed by
Edoardo Pirovano
parent
cbdf0df97b
commit
ddb83a462d
@@ -101,6 +101,10 @@ export interface CodeQL {
|
||||
threadsFlag: string,
|
||||
automationDetailsId: string | undefined
|
||||
): Promise<string>;
|
||||
/**
|
||||
* Run 'codeql database cleanup'.
|
||||
*/
|
||||
databaseCleanup(databasePath: string, cleanupLevel: string): Promise<void>;
|
||||
}
|
||||
|
||||
export interface ResolveLanguagesOutput {
|
||||
@@ -481,6 +485,7 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
|
||||
resolveLanguages: resolveFunction(partialCodeql, "resolveLanguages"),
|
||||
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
||||
databaseAnalyze: resolveFunction(partialCodeql, "databaseAnalyze"),
|
||||
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
|
||||
};
|
||||
return cachedCodeQL;
|
||||
}
|
||||
@@ -747,6 +752,18 @@ function getCodeQLForCmd(cmd: string): CodeQL {
|
||||
}).exec();
|
||||
return output;
|
||||
},
|
||||
async databaseCleanup(
|
||||
databasePath: string,
|
||||
cleanupLevel: string
|
||||
): Promise<void> {
|
||||
const args = [
|
||||
"database",
|
||||
"cleanup",
|
||||
databasePath,
|
||||
`--mode=${cleanupLevel}`,
|
||||
];
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user