Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename uploadSarif
  • Loading branch information
mbg committed Oct 22, 2025
commit 6f0fcbeea7bcf5fa25efa506a9eda9d1ee938488
4 changes: 2 additions & 2 deletions lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/upload-sarif-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {
} from "./trap-caching";
import * as uploadLib from "./upload-lib";
import { UploadResult } from "./upload-lib";
import { uploadSarif } from "./upload-sarif";
import { processAndUploadSarif } from "./upload-sarif";
import * as util from "./util";

interface AnalysisStatusReport
Expand Down Expand Up @@ -352,7 +352,7 @@ async function run() {
const category = actionsUtil.getOptionalInput("category");

if (await features.getValue(Feature.AnalyzeUseNewUpload)) {
uploadResults = await uploadSarif(
uploadResults = await processAndUploadSarif(
logger,
features,
uploadKind,
Expand Down
4 changes: 2 additions & 2 deletions src/upload-sarif-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
isThirdPartyAnalysis,
} from "./status-report";
import * as upload_lib from "./upload-lib";
import { uploadSarif } from "./upload-sarif";
import { processAndUploadSarif } from "./upload-sarif";
import {
ConfigurationError,
checkActionVersion,
Expand Down Expand Up @@ -90,7 +90,7 @@ async function run() {
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
const category = actionsUtil.getOptionalInput("category");

const uploadResults = await uploadSarif(
const uploadResults = await processAndUploadSarif(
logger,
features,
"always",
Expand Down
26 changes: 13 additions & 13 deletions src/upload-sarif.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getRunnerLogger } from "./logging";
import { createFeatures, setupTests } from "./testing-utils";
import { UploadResult } from "./upload-lib";
import * as uploadLib from "./upload-lib";
import { uploadSarif } from "./upload-sarif";
import { processAndUploadSarif } from "./upload-sarif";
import * as util from "./util";

setupTests(test);
Expand Down Expand Up @@ -39,7 +39,7 @@ function mockPostProcessSarifFiles() {
return postProcessSarifFiles;
}

const uploadSarifMacro = test.macro({
const processAndUploadSarifMacro = test.macro({
exec: async (
t: ExecutionContext<unknown>,
sarifFiles: string[],
Expand Down Expand Up @@ -71,7 +71,7 @@ const uploadSarifMacro = test.macro({
fs.writeFileSync(sarifFile, "");
}

const actual = await uploadSarif(
const actual = await processAndUploadSarif(
logger,
features,
"always",
Expand Down Expand Up @@ -116,12 +116,12 @@ const uploadSarifMacro = test.macro({
}
});
},
title: (providedTitle = "") => `uploadSarif - ${providedTitle}`,
title: (providedTitle = "") => `processAndUploadSarif - ${providedTitle}`,
});

test(
"SARIF file",
uploadSarifMacro,
processAndUploadSarifMacro,
["test.sarif"],
(tempDir) => path.join(tempDir, "test.sarif"),
{
Expand All @@ -136,7 +136,7 @@ test(

test(
"JSON file",
uploadSarifMacro,
processAndUploadSarifMacro,
["test.json"],
(tempDir) => path.join(tempDir, "test.json"),
{
Expand All @@ -151,7 +151,7 @@ test(

test(
"Code Scanning files",
uploadSarifMacro,
processAndUploadSarifMacro,
["test.json", "test.sarif"],
undefined,
{
Expand All @@ -167,7 +167,7 @@ test(

test(
"Code Quality file",
uploadSarifMacro,
processAndUploadSarifMacro,
["test.quality.sarif"],
(tempDir) => path.join(tempDir, "test.quality.sarif"),
{
Expand All @@ -182,7 +182,7 @@ test(

test(
"Mixed files",
uploadSarifMacro,
processAndUploadSarifMacro,
["test.sarif", "test.quality.sarif"],
undefined,
{
Expand All @@ -203,7 +203,7 @@ test(
},
);

test("uploadSarif doesn't upload if upload is disabled", async (t) => {
test("processAndUploadSarif doesn't upload if upload is disabled", async (t) => {
await util.withTmpDir(async (tempDir) => {
const logger = getRunnerLogger(true);
const features = createFeatures([]);
Expand All @@ -216,15 +216,15 @@ test("uploadSarif doesn't upload if upload is disabled", async (t) => {
fs.writeFileSync(toFullPath("test.sarif"), "");
fs.writeFileSync(toFullPath("test.quality.sarif"), "");

const actual = await uploadSarif(logger, features, "never", "", tempDir);
const actual = await processAndUploadSarif(logger, features, "never", "", tempDir);

t.truthy(actual);
t.assert(postProcessSarifFiles.calledTwice);
t.assert(uploadProcessedFiles.notCalled);
});
});

test("uploadSarif writes processed SARIF files if output directory is provided", async (t) => {
test("processAndUploadSarif writes processed SARIF files if output directory is provided", async (t) => {
await util.withTmpDir(async (tempDir) => {
const logger = getRunnerLogger(true);
const features = createFeatures([]);
Expand All @@ -237,7 +237,7 @@ test("uploadSarif writes processed SARIF files if output directory is provided",
fs.writeFileSync(toFullPath("test.quality.sarif"), "");

const processedOutPath = path.join(tempDir, "processed");
const actual = await uploadSarif(
const actual = await processAndUploadSarif(
logger,
features,
"never",
Expand Down
2 changes: 1 addition & 1 deletion src/upload-sarif.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type UploadSarifResults = Partial<
*
* @returns A partial mapping from analysis kinds to the upload results.
*/
export async function uploadSarif(
export async function processAndUploadSarif(
logger: Logger,
features: FeatureEnablement,
uploadKind: UploadKind,
Expand Down