mirror of
https://github.com/github/codeql-action.git
synced 2026-04-23 23:38:53 +00:00
Clean up the database if it will be uploaded
This commit is contained in:
@@ -2,16 +2,17 @@ import * as fs from "fs";
|
||||
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import { getApiClient, GitHubApiDetails } from "./api-client";
|
||||
import { getCodeQL } from "./codeql";
|
||||
import { type CodeQL } from "./codeql";
|
||||
import { Config } from "./config-utils";
|
||||
import * as gitUtils from "./git-utils";
|
||||
import { Logger } from "./logging";
|
||||
import { Logger, withGroupAsync } from "./logging";
|
||||
import { RepositoryNwo } from "./repository";
|
||||
import * as util from "./util";
|
||||
import { bundleDb, parseGitHubUrl } from "./util";
|
||||
|
||||
export async function uploadDatabases(
|
||||
repositoryNwo: RepositoryNwo,
|
||||
codeql: CodeQL,
|
||||
config: Config,
|
||||
apiDetails: GitHubApiDetails,
|
||||
logger: Logger,
|
||||
@@ -41,8 +42,13 @@ export async function uploadDatabases(
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up the database, since intermediate results may still be written to the
|
||||
// database if there is high RAM pressure.
|
||||
await withGroupAsync("Cleaning up databases", async () => {
|
||||
await codeql.databaseCleanupCluster(config, "clear");
|
||||
});
|
||||
|
||||
const client = getApiClient();
|
||||
const codeql = await getCodeQL(config.codeQLCmd);
|
||||
|
||||
const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url));
|
||||
uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`;
|
||||
|
||||
Reference in New Issue
Block a user