mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 09:37:15 +00:00
Rename SARIF_UPLOAD_TARGET
This commit is contained in:
18
lib/upload-lib.js
generated
18
lib/upload-lib.js
generated
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.InvalidSarifUploadError = exports.CodeQualityTarget = exports.CodeScanningTarget = exports.defaultIsSarif = exports.qualityIsSarif = exports.SARIF_UPLOAD_TARGET = void 0;
|
||||
exports.InvalidSarifUploadError = exports.CodeQualityTarget = exports.CodeScanningTarget = exports.defaultIsSarif = exports.qualityIsSarif = exports.SARIF_UPLOAD_ENDPOINT = void 0;
|
||||
exports.shouldShowCombineSarifFilesDeprecationWarning = shouldShowCombineSarifFilesDeprecationWarning;
|
||||
exports.populateRunAutomationDetails = populateRunAutomationDetails;
|
||||
exports.findSarifFilesInDir = findSarifFilesInDir;
|
||||
@@ -237,14 +237,14 @@ function getAutomationID(category, analysis_key, environment) {
|
||||
return api.computeAutomationID(analysis_key, environment);
|
||||
}
|
||||
// Enumerates API endpoints that accept SARIF files.
|
||||
var SARIF_UPLOAD_TARGET;
|
||||
(function (SARIF_UPLOAD_TARGET) {
|
||||
SARIF_UPLOAD_TARGET["CODE_SCANNING_UPLOAD_TARGET"] = "PUT /repos/:owner/:repo/code-scanning/analysis";
|
||||
SARIF_UPLOAD_TARGET["CODE_QUALITY_UPLOAD_TARGET"] = "PUT /repos/:owner/:repo/code-quality/analysis";
|
||||
})(SARIF_UPLOAD_TARGET || (exports.SARIF_UPLOAD_TARGET = SARIF_UPLOAD_TARGET = {}));
|
||||
var SARIF_UPLOAD_ENDPOINT;
|
||||
(function (SARIF_UPLOAD_ENDPOINT) {
|
||||
SARIF_UPLOAD_ENDPOINT["CODE_SCANNING_UPLOAD_TARGET"] = "PUT /repos/:owner/:repo/code-scanning/analysis";
|
||||
SARIF_UPLOAD_ENDPOINT["CODE_QUALITY_UPLOAD_TARGET"] = "PUT /repos/:owner/:repo/code-quality/analysis";
|
||||
})(SARIF_UPLOAD_ENDPOINT || (exports.SARIF_UPLOAD_ENDPOINT = SARIF_UPLOAD_ENDPOINT = {}));
|
||||
// Upload the given payload.
|
||||
// If the request fails then this will retry a small number of times.
|
||||
async function uploadPayload(payload, repositoryNwo, logger, target = SARIF_UPLOAD_TARGET.CODE_SCANNING_UPLOAD_TARGET) {
|
||||
async function uploadPayload(payload, repositoryNwo, logger, target = SARIF_UPLOAD_ENDPOINT.CODE_SCANNING_UPLOAD_TARGET) {
|
||||
logger.info("Uploading results");
|
||||
// If in test mode we don't want to upload the results
|
||||
if (util.isInTestMode()) {
|
||||
@@ -424,14 +424,14 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
|
||||
// Represents the Code Scanning upload target.
|
||||
exports.CodeScanningTarget = {
|
||||
name: "code scanning",
|
||||
target: SARIF_UPLOAD_TARGET.CODE_SCANNING_UPLOAD_TARGET,
|
||||
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING_UPLOAD_TARGET,
|
||||
sarifFilter: exports.defaultIsSarif,
|
||||
sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
|
||||
};
|
||||
// Represents the Code Quality upload target.
|
||||
exports.CodeQualityTarget = {
|
||||
name: "code quality",
|
||||
target: SARIF_UPLOAD_TARGET.CODE_QUALITY_UPLOAD_TARGET,
|
||||
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY_UPLOAD_TARGET,
|
||||
sarifFilter: exports.qualityIsSarif,
|
||||
sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user