mirror of
https://github.com/github/codeql-action.git
synced 2026-04-28 09:58:49 +00:00
Include base database OIDs when bundling database
This commit is contained in:
+13
-1
@@ -16,6 +16,12 @@ import { EnvVar } from "./environment";
|
||||
import { Language } from "./languages";
|
||||
import { Logger } from "./logging";
|
||||
|
||||
/**
|
||||
* The name of the file containing the base database OIDs, as stored in the
|
||||
* root of the database location.
|
||||
*/
|
||||
const BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
|
||||
|
||||
/**
|
||||
* Specifies bundle versions that are known to be broken
|
||||
* and will not be used if found in the toolcache.
|
||||
@@ -728,6 +734,10 @@ export async function codeQlVersionAtLeast(
|
||||
return semver.gte((await codeql.getVersion()).version, requiredVersion);
|
||||
}
|
||||
|
||||
export function getBaseDatabaseOidsFilePath(config: Config): string {
|
||||
return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME);
|
||||
}
|
||||
|
||||
// Create a bundle for the given DB, if it doesn't already exist
|
||||
export async function bundleDb(
|
||||
config: Config,
|
||||
@@ -745,7 +755,9 @@ export async function bundleDb(
|
||||
if (fs.existsSync(databaseBundlePath)) {
|
||||
await fs.promises.rm(databaseBundlePath, { force: true });
|
||||
}
|
||||
await codeql.databaseBundle(databasePath, databaseBundlePath, dbName);
|
||||
await codeql.databaseBundle(databasePath, databaseBundlePath, dbName, [
|
||||
BASE_DATABASE_OIDS_FILE_NAME,
|
||||
]);
|
||||
return databaseBundlePath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user