mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 14:50:21 +00:00
Add an option to upload some debugging artifacts
This commit is contained in:
+22
@@ -18,6 +18,11 @@ import { Logger } from "./logging";
|
||||
*/
|
||||
export const GITHUB_DOTCOM_URL = "https://github.com";
|
||||
|
||||
/**
|
||||
* Name of the debugging artifact.
|
||||
*/
|
||||
export const DEBUG_ARTIFACT_NAME = "debug-artifacts";
|
||||
|
||||
/**
|
||||
* Get the extra options for the codeql commands.
|
||||
*/
|
||||
@@ -542,3 +547,20 @@ export async function codeQlVersionAbove(
|
||||
): Promise<boolean> {
|
||||
return semver.gte(await codeql.getVersion(), requiredVersion);
|
||||
}
|
||||
|
||||
// Create a bundle for the given DB, if it doesn't already exist
|
||||
export async function bundleDb(
|
||||
config: Config,
|
||||
language: Language,
|
||||
codeql: CodeQL
|
||||
) {
|
||||
const databasePath = getCodeQLDatabasePath(config, language);
|
||||
const databaseBundlePath = path.resolve(
|
||||
config.dbLocation,
|
||||
`${databasePath}.zip`
|
||||
);
|
||||
if (!fs.existsSync(databaseBundlePath)) {
|
||||
await codeql.databaseBundle(databasePath, databaseBundlePath);
|
||||
}
|
||||
return databaseBundlePath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user