Skip to content

Commit b1dea65

Browse files
committed
Make postProcessAndUploadSarif the default
1 parent 4b675e4 commit b1dea65

File tree

3 files changed

+20
-141
lines changed

3 files changed

+20
-141
lines changed

lib/analyze-action.js

Lines changed: 9 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze-action.ts

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,15 @@ import { getApiDetails, getGitHubVersion } from "./api-client";
1919
import { runAutobuild } from "./autobuild";
2020
import { getTotalCacheSize, shouldStoreCache } from "./caching-utils";
2121
import { getCodeQL } from "./codeql";
22-
import {
23-
Config,
24-
getConfig,
25-
isCodeQualityEnabled,
26-
isCodeScanningEnabled,
27-
} from "./config-utils";
22+
import { Config, getConfig } from "./config-utils";
2823
import { cleanupAndUploadDatabases } from "./database-upload";
2924
import {
3025
DependencyCacheUploadStatusReport,
3126
uploadDependencyCaches,
3227
} from "./dependency-caching";
3328
import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils";
3429
import { EnvVar } from "./environment";
35-
import { Feature, Features } from "./feature-flags";
30+
import { Features } from "./feature-flags";
3631
import { KnownLanguage } from "./languages";
3732
import { getActionsLogger, Logger } from "./logging";
3833
import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay-database-utils";
@@ -358,46 +353,15 @@ async function run() {
358353
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
359354
const category = actionsUtil.getOptionalInput("category");
360355

361-
if (await features.getValue(Feature.AnalyzeUseNewUpload)) {
362-
uploadResults = await postProcessAndUploadSarif(
363-
logger,
364-
features,
365-
uploadKind,
366-
checkoutPath,
367-
outputDir,
368-
category,
369-
actionsUtil.getOptionalInput("post-processed-sarif-path"),
370-
);
371-
} else if (uploadKind === "always") {
372-
uploadResults = {};
373-
374-
if (isCodeScanningEnabled(config)) {
375-
uploadResults[analyses.AnalysisKind.CodeScanning] =
376-
await uploadLib.uploadFiles(
377-
outputDir,
378-
checkoutPath,
379-
category,
380-
features,
381-
logger,
382-
analyses.CodeScanning,
383-
);
384-
}
385-
386-
if (isCodeQualityEnabled(config)) {
387-
uploadResults[analyses.AnalysisKind.CodeQuality] =
388-
await uploadLib.uploadFiles(
389-
outputDir,
390-
checkoutPath,
391-
category,
392-
features,
393-
logger,
394-
analyses.CodeQuality,
395-
);
396-
}
397-
} else {
398-
uploadResults = {};
399-
logger.info("Not uploading results");
400-
}
356+
uploadResults = await postProcessAndUploadSarif(
357+
logger,
358+
features,
359+
uploadKind,
360+
checkoutPath,
361+
outputDir,
362+
category,
363+
actionsUtil.getOptionalInput("post-processed-sarif-path"),
364+
);
401365

402366
// Set the SARIF id outputs only if we have results for them, to avoid
403367
// having keys with empty values in the action output.

0 commit comments

Comments
 (0)