Add an option to upload some debugging artifacts

This commit is contained in:
Edoardo Pirovano 2021-10-28 14:15:22 +01:00
parent 4293754ed2
commit bc31f604d3
No known key found for this signature in database
GPG key ID: 047556B5D93FFE28
40 changed files with 374 additions and 65 deletions

View file

@ -7,6 +7,7 @@ import { Config } from "./config-utils";
import { Logger } from "./logging";
import { RepositoryNwo } from "./repository";
import * as util from "./util";
import { bundleDb } from "./util";
export async function uploadDatabases(
repositoryNwo: RepositoryNwo,
@ -54,13 +55,8 @@ export async function uploadDatabases(
const codeql = await getCodeQL(config.codeQLCmd);
for (const language of config.languages) {
// Bundle the database up into a single zip file
const databasePath = util.getCodeQLDatabasePath(config, language);
const databaseBundlePath = `${databasePath}.zip`;
await codeql.databaseBundle(databasePath, databaseBundlePath);
// Upload the database bundle
const payload = fs.readFileSync(databaseBundlePath);
const payload = fs.readFileSync(await bundleDb(config, language, codeql));
try {
await client.request(
`PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language`,