Skip to content

Commit 53abb1d

Browse files
committed
Make postProcessAndUploadSarif the default
1 parent ffa63f0 commit 53abb1d

File tree

2 files changed

+20
-130
lines changed

2 files changed

+20
-130
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.

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 { uploadDatabases } 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 { uploadOverlayBaseDatabaseToCache } from "./overlay-database-utils";
@@ -357,46 +352,15 @@ async function run() {
357352
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
358353
const category = actionsUtil.getOptionalInput("category");
359354

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

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

0 commit comments

Comments
 (0)