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
7
lib/database-upload.js
generated
7
lib/database-upload.js
generated
|
|
@ -25,6 +25,7 @@ const actionsUtil = __importStar(require("./actions-util"));
|
|||
const api_client_1 = require("./api-client");
|
||||
const codeql_1 = require("./codeql");
|
||||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
|
||||
logger.debug("Database upload disabled in workflow. Skipping upload.");
|
||||
|
|
@ -59,12 +60,8 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
|||
}
|
||||
const codeql = await (0, codeql_1.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 (0, util_1.bundleDb)(config, language, codeql));
|
||||
try {
|
||||
await client.request(`PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language`, {
|
||||
owner: repositoryNwo.owner,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue