mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 00:00:20 +08:00
Upload .quality.sarif files to CQ service in upload-sarif action
This commit is contained in:
8
lib/upload-lib.js
generated
8
lib/upload-lib.js
generated
@@ -40,10 +40,12 @@ exports.InvalidSarifUploadError = exports.CodeQualityTarget = exports.CodeScanni
|
||||
exports.shouldShowCombineSarifFilesDeprecationWarning = shouldShowCombineSarifFilesDeprecationWarning;
|
||||
exports.populateRunAutomationDetails = populateRunAutomationDetails;
|
||||
exports.findSarifFilesInDir = findSarifFilesInDir;
|
||||
exports.getSarifFilePaths = getSarifFilePaths;
|
||||
exports.readSarifFile = readSarifFile;
|
||||
exports.validateSarifFileSchema = validateSarifFileSchema;
|
||||
exports.buildPayload = buildPayload;
|
||||
exports.uploadFiles = uploadFiles;
|
||||
exports.uploadSpecifiedFiles = uploadSpecifiedFiles;
|
||||
exports.waitForProcessing = waitForProcessing;
|
||||
exports.shouldConsiderConfigurationError = shouldConsiderConfigurationError;
|
||||
exports.shouldConsiderInvalidRequest = shouldConsiderInvalidRequest;
|
||||
@@ -439,6 +441,12 @@ exports.CodeQualityTarget = {
|
||||
*/
|
||||
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget = exports.CodeScanningTarget) {
|
||||
const sarifPaths = getSarifFilePaths(inputSarifPath, uploadTarget.sarifFilter);
|
||||
return uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget);
|
||||
}
|
||||
/**
|
||||
* Uploads the given array of SARIF files.
|
||||
*/
|
||||
async function uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget = exports.CodeScanningTarget) {
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
|
||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||
|
||||
Reference in New Issue
Block a user