Move UploadKind check into uploadSarif

This commit is contained in:
Michael B. Gale
2025-10-21 23:41:40 +01:00
parent 899bf2fd1e
commit 596de7f1bc
6 changed files with 49 additions and 25 deletions
+14 -9
View File
@@ -96180,7 +96180,7 @@ function filterAlertsByDiffRange(logger, sarif) {
}
// src/upload-sarif.ts
async function uploadSarif(logger, features, checkoutPath, sarifPath, category) {
async function uploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category) {
const sarifGroups = await getGroupedSarifFilePaths(
logger,
sarifPath
@@ -96198,12 +96198,14 @@ async function uploadSarif(logger, features, checkoutPath, sarifPath, category)
category,
analysisConfig
);
uploadResults[analysisKind] = await uploadProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
);
if (uploadKind === "always") {
uploadResults[analysisKind] = await uploadProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
);
}
}
return uploadResults;
}
@@ -96402,14 +96404,17 @@ async function run() {
}
core14.setOutput("db-locations", dbLocations);
core14.setOutput("sarif-output", import_path4.default.resolve(outputDir));
const uploadInput = getOptionalInput("upload");
if (runStats && getUploadValue(uploadInput) === "always") {
const uploadKind = getUploadValue(
getOptionalInput("upload")
);
if (runStats) {
const checkoutPath = getRequiredInput("checkout_path");
const category = getOptionalInput("category");
if (await features.getValue("analyze_use_new_upload" /* AnalyzeUseNewUpload */)) {
uploadResults = await uploadSarif(
logger,
features,
uploadKind,
checkoutPath,
outputDir,
category
+10 -7
View File
@@ -93620,7 +93620,7 @@ function filterAlertsByDiffRange(logger, sarif) {
}
// src/upload-sarif.ts
async function uploadSarif(logger, features, checkoutPath, sarifPath, category) {
async function uploadSarif(logger, features, uploadKind, checkoutPath, sarifPath, category) {
const sarifGroups = await getGroupedSarifFilePaths(
logger,
sarifPath
@@ -93638,12 +93638,14 @@ async function uploadSarif(logger, features, checkoutPath, sarifPath, category)
category,
analysisConfig
);
uploadResults[analysisKind] = await uploadProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
);
if (uploadKind === "always") {
uploadResults[analysisKind] = await uploadProcessedFiles(
logger,
checkoutPath,
analysisConfig,
processingResults
);
}
}
return uploadResults;
}
@@ -93698,6 +93700,7 @@ async function run() {
const uploadResults = await uploadSarif(
logger,
features,
"always",
checkoutPath,
sarifPath,
category