Add an option to upload some debugging artifacts
This commit is contained in:
parent
4293754ed2
commit
bc31f604d3
40 changed files with 374 additions and 65 deletions
22
src/util.ts
22
src/util.ts
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue