Skip to content

Commit 6f0fcbe

Browse files
committed
Rename uploadSarif
1 parent 89d3359 commit 6f0fcbe

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

lib/analyze-action.js

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

lib/upload-sarif-action.js

Lines changed: 2 additions & 2 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
} from "./trap-caching";
5353
import * as uploadLib from "./upload-lib";
5454
import { UploadResult } from "./upload-lib";
55-
import { uploadSarif } from "./upload-sarif";
55+
import { processAndUploadSarif } from "./upload-sarif";
5656
import * as util from "./util";
5757

5858
interface AnalysisStatusReport
@@ -352,7 +352,7 @@ async function run() {
352352
const category = actionsUtil.getOptionalInput("category");
353353

354354
if (await features.getValue(Feature.AnalyzeUseNewUpload)) {
355-
uploadResults = await uploadSarif(
355+
uploadResults = await processAndUploadSarif(
356356
logger,
357357
features,
358358
uploadKind,

src/upload-sarif-action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
isThirdPartyAnalysis,
1717
} from "./status-report";
1818
import * as upload_lib from "./upload-lib";
19-
import { uploadSarif } from "./upload-sarif";
19+
import { processAndUploadSarif } from "./upload-sarif";
2020
import {
2121
ConfigurationError,
2222
checkActionVersion,
@@ -90,7 +90,7 @@ async function run() {
9090
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
9191
const category = actionsUtil.getOptionalInput("category");
9292

93-
const uploadResults = await uploadSarif(
93+
const uploadResults = await processAndUploadSarif(
9494
logger,
9595
features,
9696
"always",

src/upload-sarif.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getRunnerLogger } from "./logging";
99
import { createFeatures, setupTests } from "./testing-utils";
1010
import { UploadResult } from "./upload-lib";
1111
import * as uploadLib from "./upload-lib";
12-
import { uploadSarif } from "./upload-sarif";
12+
import { processAndUploadSarif } from "./upload-sarif";
1313
import * as util from "./util";
1414

1515
setupTests(test);
@@ -39,7 +39,7 @@ function mockPostProcessSarifFiles() {
3939
return postProcessSarifFiles;
4040
}
4141

42-
const uploadSarifMacro = test.macro({
42+
const processAndUploadSarifMacro = test.macro({
4343
exec: async (
4444
t: ExecutionContext<unknown>,
4545
sarifFiles: string[],
@@ -71,7 +71,7 @@ const uploadSarifMacro = test.macro({
7171
fs.writeFileSync(sarifFile, "");
7272
}
7373

74-
const actual = await uploadSarif(
74+
const actual = await processAndUploadSarif(
7575
logger,
7676
features,
7777
"always",
@@ -116,12 +116,12 @@ const uploadSarifMacro = test.macro({
116116
}
117117
});
118118
},
119-
title: (providedTitle = "") => `uploadSarif - ${providedTitle}`,
119+
title: (providedTitle = "") => `processAndUploadSarif - ${providedTitle}`,
120120
});
121121

122122
test(
123123
"SARIF file",
124-
uploadSarifMacro,
124+
processAndUploadSarifMacro,
125125
["test.sarif"],
126126
(tempDir) => path.join(tempDir, "test.sarif"),
127127
{
@@ -136,7 +136,7 @@ test(
136136

137137
test(
138138
"JSON file",
139-
uploadSarifMacro,
139+
processAndUploadSarifMacro,
140140
["test.json"],
141141
(tempDir) => path.join(tempDir, "test.json"),
142142
{
@@ -151,7 +151,7 @@ test(
151151

152152
test(
153153
"Code Scanning files",
154-
uploadSarifMacro,
154+
processAndUploadSarifMacro,
155155
["test.json", "test.sarif"],
156156
undefined,
157157
{
@@ -167,7 +167,7 @@ test(
167167

168168
test(
169169
"Code Quality file",
170-
uploadSarifMacro,
170+
processAndUploadSarifMacro,
171171
["test.quality.sarif"],
172172
(tempDir) => path.join(tempDir, "test.quality.sarif"),
173173
{
@@ -182,7 +182,7 @@ test(
182182

183183
test(
184184
"Mixed files",
185-
uploadSarifMacro,
185+
processAndUploadSarifMacro,
186186
["test.sarif", "test.quality.sarif"],
187187
undefined,
188188
{
@@ -203,7 +203,7 @@ test(
203203
},
204204
);
205205

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

219-
const actual = await uploadSarif(logger, features, "never", "", tempDir);
219+
const actual = await processAndUploadSarif(logger, features, "never", "", tempDir);
220220

221221
t.truthy(actual);
222222
t.assert(postProcessSarifFiles.calledTwice);
223223
t.assert(uploadProcessedFiles.notCalled);
224224
});
225225
});
226226

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

239239
const processedOutPath = path.join(tempDir, "processed");
240-
const actual = await uploadSarif(
240+
const actual = await processAndUploadSarif(
241241
logger,
242242
features,
243243
"never",

src/upload-sarif.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type UploadSarifResults = Partial<
2323
*
2424
* @returns A partial mapping from analysis kinds to the upload results.
2525
*/
26-
export async function uploadSarif(
26+
export async function processAndUploadSarif(
2727
logger: Logger,
2828
features: FeatureEnablement,
2929
uploadKind: UploadKind,

0 commit comments

Comments
 (0)