Avoid reloading features when uploading SARIF
This commit is contained in:
parent
6c2a71ced3
commit
9679491cab
15 changed files with 37 additions and 26 deletions
7
lib/upload-lib.js
generated
7
lib/upload-lib.js
generated
|
|
@ -49,7 +49,6 @@ const api_client_1 = require("./api-client");
|
|||
const codeql_1 = require("./codeql");
|
||||
const config_utils_1 = require("./config-utils");
|
||||
const environment_1 = require("./environment");
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const fingerprints = __importStar(require("./fingerprints"));
|
||||
const init_1 = require("./init");
|
||||
const repository_1 = require("./repository");
|
||||
|
|
@ -386,13 +385,11 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
|
|||
* Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers
|
||||
* to.
|
||||
*/
|
||||
async function uploadFiles(sarifPath, checkoutPath, category, logger) {
|
||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
|
||||
async function uploadFiles(sarifPath, checkoutPath, category, features, logger) {
|
||||
const sarifFiles = getSarifFilePaths(sarifPath);
|
||||
logger.startGroup("Uploading results");
|
||||
logger.info(`Processing sarif files: ${JSON.stringify(sarifFiles)}`);
|
||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
|
||||
// Validate that the files we were asked to upload are all valid SARIF files
|
||||
for (const file of sarifFiles) {
|
||||
validateSarifFileSchema(file, logger);
|
||||
|
|
@ -419,7 +416,7 @@ async function uploadFiles(sarifPath, checkoutPath, category, logger) {
|
|||
const numResultInSarif = countResultsInSarif(sarifPayload);
|
||||
logger.debug(`Number of results in upload: ${numResultInSarif}`);
|
||||
// Make the upload
|
||||
const sarifID = await uploadPayload(payload, repositoryNwo, logger);
|
||||
const sarifID = await uploadPayload(payload, (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), logger);
|
||||
logger.endGroup();
|
||||
return {
|
||||
statusReport: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue