Skip to content

Commit 6fbdd5f

Browse files
committed
Split SARIF uploading steps from uploadSpecifiedFiles into a function
1 parent 489ed91 commit 6fbdd5f

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
@@ -797,8 +797,6 @@ export async function uploadSpecifiedFiles(
797797
logger: Logger,
798798
uploadTarget: analyses.AnalysisConfig,
799799
): Promise<UploadResult> {
800-
logger.startGroup(`Uploading ${uploadTarget.name} results`);
801-
802800
const processingResults: PostProcessingResults = await postProcessSarifFiles(
803801
logger,
804802
features,
@@ -807,6 +805,33 @@ export async function uploadSpecifiedFiles(
807805
category,
808806
uploadTarget,
809807
);
808+
809+
return uploadProcessedFiles(
810+
logger,
811+
checkoutPath,
812+
uploadTarget,
813+
processingResults,
814+
);
815+
}
816+
817+
/**
818+
* Uploads the
819+
*
820+
* @param logger The logger to use.
821+
* @param checkoutPath The path at which the repository was checked out.
822+
* @param uploadTarget The analysis configuration.
823+
* @param processingResults The results of post-processing SARIF files.
824+
*
825+
* @returns The results of uploading the `processingResults` to `uploadTarget`.
826+
*/
827+
export async function uploadProcessedFiles(
828+
logger: Logger,
829+
checkoutPath: string,
830+
uploadTarget: analyses.AnalysisConfig,
831+
processingResults: PostProcessingResults,
832+
): Promise<UploadResult> {
833+
logger.startGroup(`Uploading ${uploadTarget.name} results`);
834+
810835
const sarif = processingResults.sarif;
811836

812837
const toolNames = util.getToolNames(sarif);

0 commit comments

Comments
 (0)