Skip to content

Commit c94a451

Browse files
committed
Split SARIF uploading steps from uploadSpecifiedFiles into a function
1 parent 922a451 commit c94a451

File tree

5 files changed

+65
-6
lines changed

5 files changed

+65
-6
lines changed

lib/analyze-action.js

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

lib/init-action-post.js

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

lib/upload-lib.js

Lines changed: 11 additions & 1 deletion
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: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/upload-lib.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,6 @@ export async function uploadSpecifiedFiles(
796796
logger: Logger,
797797
uploadTarget: analyses.AnalysisConfig,
798798
): Promise<UploadResult> {
799-
logger.startGroup(`Uploading ${uploadTarget.name} results`);
800-
801799
const processingResults: PostProcessingResults = await postProcessSarifFiles(
802800
logger,
803801
features,
@@ -806,6 +804,33 @@ export async function uploadSpecifiedFiles(
806804
category,
807805
uploadTarget,
808806
);
807+
808+
return uploadProcessedFiles(
809+
logger,
810+
checkoutPath,
811+
uploadTarget,
812+
processingResults,
813+
);
814+
}
815+
816+
/**
817+
* Uploads the
818+
*
819+
* @param logger The logger to use.
820+
* @param checkoutPath The path at which the repository was checked out.
821+
* @param uploadTarget The analysis configuration.
822+
* @param processingResults The results of post-processing SARIF files.
823+
*
824+
* @returns The results of uploading the `processingResults` to `uploadTarget`.
825+
*/
826+
export async function uploadProcessedFiles(
827+
logger: Logger,
828+
checkoutPath: string,
829+
uploadTarget: analyses.AnalysisConfig,
830+
processingResults: PostProcessingResults,
831+
): Promise<UploadResult> {
832+
logger.startGroup(`Uploading ${uploadTarget.name} results`);
833+
809834
const sarif = processingResults.sarif;
810835

811836
const toolNames = util.getToolNames(sarif);

0 commit comments

Comments
 (0)