mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 01:08:46 +00:00
Split SARIF uploading steps from uploadSpecifiedFiles into a function
This commit is contained in:
Generated
+9
-1
@@ -95947,7 +95947,6 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log
|
||||
);
|
||||
}
|
||||
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const processingResults = await postProcessSarifFiles(
|
||||
logger,
|
||||
features,
|
||||
@@ -95956,6 +95955,15 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
|
||||
category,
|
||||
uploadTarget
|
||||
);
|
||||
return uploadProcessedFiles(
|
||||
logger,
|
||||
checkoutPath,
|
||||
uploadTarget,
|
||||
processingResults
|
||||
);
|
||||
}
|
||||
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const sarif = processingResults.sarif;
|
||||
const toolNames = getToolNames(sarif);
|
||||
logger.debug(`Validating that each SARIF run has a unique category`);
|
||||
|
||||
Generated
+9
-1
@@ -133358,7 +133358,6 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log
|
||||
);
|
||||
}
|
||||
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const processingResults = await postProcessSarifFiles(
|
||||
logger,
|
||||
features,
|
||||
@@ -133367,6 +133366,15 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
|
||||
category,
|
||||
uploadTarget
|
||||
);
|
||||
return uploadProcessedFiles(
|
||||
logger,
|
||||
checkoutPath,
|
||||
uploadTarget,
|
||||
processingResults
|
||||
);
|
||||
}
|
||||
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const sarif = processingResults.sarif;
|
||||
const toolNames = getToolNames(sarif);
|
||||
logger.debug(`Validating that each SARIF run has a unique category`);
|
||||
|
||||
Generated
+11
-1
@@ -84855,6 +84855,7 @@ __export(upload_lib_exports, {
|
||||
throwIfCombineSarifFilesDisabled: () => throwIfCombineSarifFilesDisabled,
|
||||
uploadFiles: () => uploadFiles,
|
||||
uploadPayload: () => uploadPayload,
|
||||
uploadProcessedFiles: () => uploadProcessedFiles,
|
||||
uploadSpecifiedFiles: () => uploadSpecifiedFiles,
|
||||
validateSarifFileSchema: () => validateSarifFileSchema,
|
||||
validateUniqueCategory: () => validateUniqueCategory,
|
||||
@@ -92762,7 +92763,6 @@ async function uploadFiles(inputSarifPath, checkoutPath, category, features, log
|
||||
);
|
||||
}
|
||||
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const processingResults = await postProcessSarifFiles(
|
||||
logger,
|
||||
features,
|
||||
@@ -92771,6 +92771,15 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
|
||||
category,
|
||||
uploadTarget
|
||||
);
|
||||
return uploadProcessedFiles(
|
||||
logger,
|
||||
checkoutPath,
|
||||
uploadTarget,
|
||||
processingResults
|
||||
);
|
||||
}
|
||||
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const sarif = processingResults.sarif;
|
||||
const toolNames = getToolNames(sarif);
|
||||
logger.debug(`Validating that each SARIF run has a unique category`);
|
||||
@@ -93001,6 +93010,7 @@ function filterAlertsByDiffRange(logger, sarif) {
|
||||
throwIfCombineSarifFilesDisabled,
|
||||
uploadFiles,
|
||||
uploadPayload,
|
||||
uploadProcessedFiles,
|
||||
uploadSpecifiedFiles,
|
||||
validateSarifFileSchema,
|
||||
validateUniqueCategory,
|
||||
|
||||
Generated
+9
-1
@@ -93403,7 +93403,6 @@ async function postProcessSarifFiles(logger, features, checkoutPath, sarifPaths,
|
||||
return { sarif, analysisKey, environment };
|
||||
}
|
||||
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const processingResults = await postProcessSarifFiles(
|
||||
logger,
|
||||
features,
|
||||
@@ -93412,6 +93411,15 @@ async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features
|
||||
category,
|
||||
uploadTarget
|
||||
);
|
||||
return uploadProcessedFiles(
|
||||
logger,
|
||||
checkoutPath,
|
||||
uploadTarget,
|
||||
processingResults
|
||||
);
|
||||
}
|
||||
async function uploadProcessedFiles(logger, checkoutPath, uploadTarget, processingResults) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
const sarif = processingResults.sarif;
|
||||
const toolNames = getToolNames(sarif);
|
||||
logger.debug(`Validating that each SARIF run has a unique category`);
|
||||
|
||||
+27
-2
@@ -797,8 +797,6 @@ export async function uploadSpecifiedFiles(
|
||||
logger: Logger,
|
||||
uploadTarget: analyses.AnalysisConfig,
|
||||
): Promise<UploadResult> {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
|
||||
const processingResults: PostProcessingResults = await postProcessSarifFiles(
|
||||
logger,
|
||||
features,
|
||||
@@ -807,6 +805,33 @@ export async function uploadSpecifiedFiles(
|
||||
category,
|
||||
uploadTarget,
|
||||
);
|
||||
|
||||
return uploadProcessedFiles(
|
||||
logger,
|
||||
checkoutPath,
|
||||
uploadTarget,
|
||||
processingResults,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads the
|
||||
*
|
||||
* @param logger The logger to use.
|
||||
* @param checkoutPath The path at which the repository was checked out.
|
||||
* @param uploadTarget The analysis configuration.
|
||||
* @param processingResults The results of post-processing SARIF files.
|
||||
*
|
||||
* @returns The results of uploading the `processingResults` to `uploadTarget`.
|
||||
*/
|
||||
export async function uploadProcessedFiles(
|
||||
logger: Logger,
|
||||
checkoutPath: string,
|
||||
uploadTarget: analyses.AnalysisConfig,
|
||||
processingResults: PostProcessingResults,
|
||||
): Promise<UploadResult> {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
|
||||
const sarif = processingResults.sarif;
|
||||
|
||||
const toolNames = util.getToolNames(sarif);
|
||||
|
||||
Reference in New Issue
Block a user