Rename SARIF_UPLOAD_ENDPOINT members
This commit is contained in:
parent
362ebf85da
commit
65d1e45f0b
3 changed files with 9 additions and 9 deletions
8
lib/upload-lib.js
generated
8
lib/upload-lib.js
generated
|
|
@ -239,8 +239,8 @@ function getAutomationID(category, analysis_key, environment) {
|
||||||
// Enumerates API endpoints that accept SARIF files.
|
// Enumerates API endpoints that accept SARIF files.
|
||||||
var SARIF_UPLOAD_ENDPOINT;
|
var SARIF_UPLOAD_ENDPOINT;
|
||||||
(function (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_SCANNING"] = "PUT /repos/:owner/:repo/code-scanning/analysis";
|
||||||
SARIF_UPLOAD_ENDPOINT["CODE_QUALITY_UPLOAD_TARGET"] = "PUT /repos/:owner/:repo/code-quality/analysis";
|
SARIF_UPLOAD_ENDPOINT["CODE_QUALITY"] = "PUT /repos/:owner/:repo/code-quality/analysis";
|
||||||
})(SARIF_UPLOAD_ENDPOINT || (exports.SARIF_UPLOAD_ENDPOINT = SARIF_UPLOAD_ENDPOINT = {}));
|
})(SARIF_UPLOAD_ENDPOINT || (exports.SARIF_UPLOAD_ENDPOINT = SARIF_UPLOAD_ENDPOINT = {}));
|
||||||
// Upload the given payload.
|
// Upload the given payload.
|
||||||
// If the request fails then this will retry a small number of times.
|
// If the request fails then this will retry a small number of times.
|
||||||
|
|
@ -420,14 +420,14 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
|
||||||
// Represents the Code Scanning upload target.
|
// Represents the Code Scanning upload target.
|
||||||
exports.CodeScanningTarget = {
|
exports.CodeScanningTarget = {
|
||||||
name: "code scanning",
|
name: "code scanning",
|
||||||
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING_UPLOAD_TARGET,
|
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING,
|
||||||
sarifPredicate: (name) => name.endsWith(".sarif") && !exports.CodeQualityTarget.sarifPredicate(name),
|
sarifPredicate: (name) => name.endsWith(".sarif") && !exports.CodeQualityTarget.sarifPredicate(name),
|
||||||
sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
|
sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
|
||||||
};
|
};
|
||||||
// Represents the Code Quality upload target.
|
// Represents the Code Quality upload target.
|
||||||
exports.CodeQualityTarget = {
|
exports.CodeQualityTarget = {
|
||||||
name: "code quality",
|
name: "code quality",
|
||||||
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY_UPLOAD_TARGET,
|
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY,
|
||||||
sarifPredicate: (name) => name.endsWith(".quality.sarif"),
|
sarifPredicate: (name) => name.endsWith(".quality.sarif"),
|
||||||
sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
|
sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -308,8 +308,8 @@ function getAutomationID(
|
||||||
|
|
||||||
// Enumerates API endpoints that accept SARIF files.
|
// Enumerates API endpoints that accept SARIF files.
|
||||||
export enum SARIF_UPLOAD_ENDPOINT {
|
export enum SARIF_UPLOAD_ENDPOINT {
|
||||||
CODE_SCANNING_UPLOAD_TARGET = "PUT /repos/:owner/:repo/code-scanning/analysis",
|
CODE_SCANNING = "PUT /repos/:owner/:repo/code-scanning/analysis",
|
||||||
CODE_QUALITY_UPLOAD_TARGET = "PUT /repos/:owner/:repo/code-quality/analysis",
|
CODE_QUALITY = "PUT /repos/:owner/:repo/code-quality/analysis",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload the given payload.
|
// Upload the given payload.
|
||||||
|
|
@ -588,7 +588,7 @@ export interface UploadTarget {
|
||||||
// Represents the Code Scanning upload target.
|
// Represents the Code Scanning upload target.
|
||||||
export const CodeScanningTarget: UploadTarget = {
|
export const CodeScanningTarget: UploadTarget = {
|
||||||
name: "code scanning",
|
name: "code scanning",
|
||||||
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING_UPLOAD_TARGET,
|
target: SARIF_UPLOAD_ENDPOINT.CODE_SCANNING,
|
||||||
sarifPredicate: (name) =>
|
sarifPredicate: (name) =>
|
||||||
name.endsWith(".sarif") && !CodeQualityTarget.sarifPredicate(name),
|
name.endsWith(".sarif") && !CodeQualityTarget.sarifPredicate(name),
|
||||||
sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
|
sentinelPrefix: "CODEQL_UPLOAD_SARIF_",
|
||||||
|
|
@ -597,7 +597,7 @@ export const CodeScanningTarget: UploadTarget = {
|
||||||
// Represents the Code Quality upload target.
|
// Represents the Code Quality upload target.
|
||||||
export const CodeQualityTarget: UploadTarget = {
|
export const CodeQualityTarget: UploadTarget = {
|
||||||
name: "code quality",
|
name: "code quality",
|
||||||
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY_UPLOAD_TARGET,
|
target: SARIF_UPLOAD_ENDPOINT.CODE_QUALITY,
|
||||||
sarifPredicate: (name) => name.endsWith(".quality.sarif"),
|
sarifPredicate: (name) => name.endsWith(".quality.sarif"),
|
||||||
sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
|
sentinelPrefix: "CODEQL_UPLOAD_QUALITY_SARIF_",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue