mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 01:08:46 +00:00
Merge branch 'main' into mbg/analyze/use-upload-sarif
This commit is contained in:
Generated
+1327
-21
File diff suppressed because it is too large
Load Diff
Generated
+1403
-1399
File diff suppressed because it is too large
Load Diff
Generated
+1351
-28
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"bundleVersion": "codeql-bundle-v2.23.2",
|
||||
"cliVersion": "2.23.2",
|
||||
"priorBundleVersion": "codeql-bundle-v2.23.1",
|
||||
"priorCliVersion": "2.23.1"
|
||||
"bundleVersion": "codeql-bundle-v2.23.3",
|
||||
"cliVersion": "2.23.3",
|
||||
"priorBundleVersion": "codeql-bundle-v2.23.2",
|
||||
"priorCliVersion": "2.23.2"
|
||||
}
|
||||
|
||||
Generated
+1413
-1407
File diff suppressed because it is too large
Load Diff
Generated
+1688
-152
File diff suppressed because it is too large
Load Diff
Generated
+1346
-24
File diff suppressed because it is too large
Load Diff
Generated
+88985
File diff suppressed because one or more lines are too long
Generated
+1327
-21
File diff suppressed because it is too large
Load Diff
Generated
+1345
-26
File diff suppressed because it is too large
Load Diff
Generated
+104
-108
@@ -20885,19 +20885,19 @@ var require_validator = __commonJS({
|
||||
var SchemaError = helpers.SchemaError;
|
||||
var SchemaContext = helpers.SchemaContext;
|
||||
var anonymousBase = "/";
|
||||
var Validator2 = function Validator3() {
|
||||
this.customFormats = Object.create(Validator3.prototype.customFormats);
|
||||
var Validator3 = function Validator4() {
|
||||
this.customFormats = Object.create(Validator4.prototype.customFormats);
|
||||
this.schemas = {};
|
||||
this.unresolvedRefs = [];
|
||||
this.types = Object.create(types);
|
||||
this.attributes = Object.create(attribute.validators);
|
||||
};
|
||||
Validator2.prototype.customFormats = {};
|
||||
Validator2.prototype.schemas = null;
|
||||
Validator2.prototype.types = null;
|
||||
Validator2.prototype.attributes = null;
|
||||
Validator2.prototype.unresolvedRefs = null;
|
||||
Validator2.prototype.addSchema = function addSchema(schema2, base) {
|
||||
Validator3.prototype.customFormats = {};
|
||||
Validator3.prototype.schemas = null;
|
||||
Validator3.prototype.types = null;
|
||||
Validator3.prototype.attributes = null;
|
||||
Validator3.prototype.unresolvedRefs = null;
|
||||
Validator3.prototype.addSchema = function addSchema(schema2, base) {
|
||||
var self2 = this;
|
||||
if (!schema2) {
|
||||
return null;
|
||||
@@ -20915,25 +20915,25 @@ var require_validator = __commonJS({
|
||||
});
|
||||
return this.schemas[ourUri];
|
||||
};
|
||||
Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) {
|
||||
Validator3.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) {
|
||||
if (!Array.isArray(schemas)) return;
|
||||
for (var i = 0; i < schemas.length; i++) {
|
||||
this.addSubSchema(baseuri, schemas[i]);
|
||||
}
|
||||
};
|
||||
Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) {
|
||||
Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) {
|
||||
if (!schemas || typeof schemas != "object") return;
|
||||
for (var p in schemas) {
|
||||
this.addSubSchema(baseuri, schemas[p]);
|
||||
}
|
||||
};
|
||||
Validator2.prototype.setSchemas = function setSchemas(schemas) {
|
||||
Validator3.prototype.setSchemas = function setSchemas(schemas) {
|
||||
this.schemas = schemas;
|
||||
};
|
||||
Validator2.prototype.getSchema = function getSchema(urn) {
|
||||
Validator3.prototype.getSchema = function getSchema(urn) {
|
||||
return this.schemas[urn];
|
||||
};
|
||||
Validator2.prototype.validate = function validate(instance, schema2, options, ctx) {
|
||||
Validator3.prototype.validate = function validate(instance, schema2, options, ctx) {
|
||||
if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) {
|
||||
throw new SchemaError("Expected `schema` to be an object or boolean");
|
||||
}
|
||||
@@ -20971,7 +20971,7 @@ var require_validator = __commonJS({
|
||||
if (typeof ref == "string") return ref;
|
||||
return false;
|
||||
}
|
||||
Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) {
|
||||
Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) {
|
||||
var result = new ValidatorResult(instance, schema2, options, ctx);
|
||||
if (typeof schema2 === "boolean") {
|
||||
if (schema2 === true) {
|
||||
@@ -21021,17 +21021,17 @@ var require_validator = __commonJS({
|
||||
}
|
||||
return result;
|
||||
};
|
||||
Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) {
|
||||
Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) {
|
||||
schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx));
|
||||
};
|
||||
Validator2.prototype.superResolve = function superResolve(schema2, ctx) {
|
||||
Validator3.prototype.superResolve = function superResolve(schema2, ctx) {
|
||||
var ref = shouldResolve(schema2);
|
||||
if (ref) {
|
||||
return this.resolve(schema2, ref, ctx).subschema;
|
||||
}
|
||||
return schema2;
|
||||
};
|
||||
Validator2.prototype.resolve = function resolve6(schema2, switchSchema, ctx) {
|
||||
Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) {
|
||||
switchSchema = ctx.resolve(switchSchema);
|
||||
if (ctx.schemas[switchSchema]) {
|
||||
return { subschema: ctx.schemas[switchSchema], switchSchema };
|
||||
@@ -21048,7 +21048,7 @@ var require_validator = __commonJS({
|
||||
}
|
||||
return { subschema, switchSchema };
|
||||
};
|
||||
Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) {
|
||||
Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) {
|
||||
if (type2 === void 0) {
|
||||
return;
|
||||
} else if (type2 === null) {
|
||||
@@ -21063,7 +21063,7 @@ var require_validator = __commonJS({
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var types = Validator2.prototype.types = {};
|
||||
var types = Validator3.prototype.types = {};
|
||||
types.string = function testString(instance) {
|
||||
return typeof instance == "string";
|
||||
};
|
||||
@@ -21091,7 +21091,7 @@ var require_validator = __commonJS({
|
||||
types.object = function testObject(instance) {
|
||||
return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date);
|
||||
};
|
||||
module2.exports = Validator2;
|
||||
module2.exports = Validator3;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21099,7 +21099,7 @@ var require_validator = __commonJS({
|
||||
var require_lib2 = __commonJS({
|
||||
"node_modules/jsonschema/lib/index.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var Validator2 = module2.exports.Validator = require_validator();
|
||||
var Validator3 = module2.exports.Validator = require_validator();
|
||||
module2.exports.ValidatorResult = require_helpers().ValidatorResult;
|
||||
module2.exports.ValidatorResultError = require_helpers().ValidatorResultError;
|
||||
module2.exports.ValidationError = require_helpers().ValidationError;
|
||||
@@ -21107,7 +21107,7 @@ var require_lib2 = __commonJS({
|
||||
module2.exports.SchemaScanResult = require_scan().SchemaScanResult;
|
||||
module2.exports.scan = require_scan().scan;
|
||||
module2.exports.validate = function(instance, schema2, options) {
|
||||
var v = new Validator2();
|
||||
var v = new Validator3();
|
||||
return v.validate(instance, schema2, options);
|
||||
};
|
||||
}
|
||||
@@ -21899,14 +21899,14 @@ var require_dist_node4 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -21998,7 +21998,7 @@ var require_dist_node5 = __commonJS({
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error2 = require_dist_node4();
|
||||
var import_request_error = require_dist_node4();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
@@ -22050,7 +22050,7 @@ var require_dist_node5 = __commonJS({
|
||||
if (status < 400) {
|
||||
return;
|
||||
}
|
||||
throw new import_request_error2.RequestError(response.statusText, status, {
|
||||
throw new import_request_error.RequestError(response.statusText, status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22061,7 +22061,7 @@ var require_dist_node5 = __commonJS({
|
||||
});
|
||||
}
|
||||
if (status === 304) {
|
||||
throw new import_request_error2.RequestError("Not modified", status, {
|
||||
throw new import_request_error.RequestError("Not modified", status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22073,7 +22073,7 @@ var require_dist_node5 = __commonJS({
|
||||
}
|
||||
if (status >= 400) {
|
||||
const data = await getResponseData(response);
|
||||
const error2 = new import_request_error2.RequestError(toErrorMessage(data), status, {
|
||||
const error2 = new import_request_error.RequestError(toErrorMessage(data), status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22093,7 +22093,7 @@ var require_dist_node5 = __commonJS({
|
||||
data
|
||||
};
|
||||
}).catch((error2) => {
|
||||
if (error2 instanceof import_request_error2.RequestError)
|
||||
if (error2 instanceof import_request_error.RequestError)
|
||||
throw error2;
|
||||
else if (error2.name === "AbortError")
|
||||
throw error2;
|
||||
@@ -22105,7 +22105,7 @@ var require_dist_node5 = __commonJS({
|
||||
message = error2.cause;
|
||||
}
|
||||
}
|
||||
throw new import_request_error2.RequestError(message, 500, {
|
||||
throw new import_request_error.RequestError(message, 500, {
|
||||
request: requestOptions
|
||||
});
|
||||
});
|
||||
@@ -22547,14 +22547,14 @@ var require_dist_node7 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -22646,7 +22646,7 @@ var require_dist_node8 = __commonJS({
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error2 = require_dist_node7();
|
||||
var import_request_error = require_dist_node7();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
@@ -22698,7 +22698,7 @@ var require_dist_node8 = __commonJS({
|
||||
if (status < 400) {
|
||||
return;
|
||||
}
|
||||
throw new import_request_error2.RequestError(response.statusText, status, {
|
||||
throw new import_request_error.RequestError(response.statusText, status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22709,7 +22709,7 @@ var require_dist_node8 = __commonJS({
|
||||
});
|
||||
}
|
||||
if (status === 304) {
|
||||
throw new import_request_error2.RequestError("Not modified", status, {
|
||||
throw new import_request_error.RequestError("Not modified", status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22721,7 +22721,7 @@ var require_dist_node8 = __commonJS({
|
||||
}
|
||||
if (status >= 400) {
|
||||
const data = await getResponseData(response);
|
||||
const error2 = new import_request_error2.RequestError(toErrorMessage(data), status, {
|
||||
const error2 = new import_request_error.RequestError(toErrorMessage(data), status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -22741,7 +22741,7 @@ var require_dist_node8 = __commonJS({
|
||||
data
|
||||
};
|
||||
}).catch((error2) => {
|
||||
if (error2 instanceof import_request_error2.RequestError)
|
||||
if (error2 instanceof import_request_error.RequestError)
|
||||
throw error2;
|
||||
else if (error2.name === "AbortError")
|
||||
throw error2;
|
||||
@@ -22753,7 +22753,7 @@ var require_dist_node8 = __commonJS({
|
||||
message = error2.cause;
|
||||
}
|
||||
}
|
||||
throw new import_request_error2.RequestError(message, 500, {
|
||||
throw new import_request_error.RequestError(message, 500, {
|
||||
request: requestOptions
|
||||
});
|
||||
});
|
||||
@@ -33606,7 +33606,7 @@ var require_package = __commonJS({
|
||||
"package.json"(exports2, module2) {
|
||||
module2.exports = {
|
||||
name: "codeql",
|
||||
version: "4.30.9",
|
||||
version: "4.30.10",
|
||||
private: true,
|
||||
description: "CodeQL action",
|
||||
scripts: {
|
||||
@@ -33654,7 +33654,7 @@ var require_package = __commonJS({
|
||||
jsonschema: "1.4.1",
|
||||
long: "^5.3.2",
|
||||
"node-forge": "^1.3.1",
|
||||
octokit: "^5.0.3",
|
||||
octokit: "^5.0.4",
|
||||
semver: "^7.7.3",
|
||||
uuid: "^13.0.0"
|
||||
},
|
||||
@@ -33662,7 +33662,7 @@ var require_package = __commonJS({
|
||||
"@ava/typescript": "6.0.0",
|
||||
"@eslint/compat": "^1.4.0",
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.37.0",
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@octokit/types": "^15.0.0",
|
||||
"@types/archiver": "^6.0.3",
|
||||
@@ -33673,10 +33673,10 @@ var require_package = __commonJS({
|
||||
"@types/node-forge": "^1.3.14",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@types/sinon": "^17.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.41.0",
|
||||
ava: "^6.4.1",
|
||||
esbuild: "^0.25.10",
|
||||
esbuild: "^0.25.11",
|
||||
eslint: "^8.57.1",
|
||||
"eslint-import-resolver-typescript": "^3.8.7",
|
||||
"eslint-plugin-filenames": "^1.3.2",
|
||||
@@ -35065,14 +35065,14 @@ var require_dist_node14 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -35174,7 +35174,7 @@ var require_dist_node15 = __commonJS({
|
||||
throw error2;
|
||||
}
|
||||
var import_light = __toESM2(require_light());
|
||||
var import_request_error2 = require_dist_node14();
|
||||
var import_request_error = require_dist_node14();
|
||||
async function wrapRequest(state, octokit, request, options) {
|
||||
const limiter = new import_light.default();
|
||||
limiter.on("failed", function(error2, info4) {
|
||||
@@ -35195,7 +35195,7 @@ var require_dist_node15 = __commonJS({
|
||||
if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(
|
||||
response.data.errors[0].message
|
||||
)) {
|
||||
const error2 = new import_request_error2.RequestError(response.data.errors[0].message, 500, {
|
||||
const error2 = new import_request_error.RequestError(response.data.errors[0].message, 500, {
|
||||
request: options,
|
||||
response
|
||||
});
|
||||
@@ -80921,14 +80921,14 @@ var require_tool_cache = __commonJS({
|
||||
var assert_1 = require("assert");
|
||||
var exec_1 = require_exec();
|
||||
var retry_helper_1 = require_retry_helper();
|
||||
var HTTPError = class extends Error {
|
||||
var HTTPError2 = class extends Error {
|
||||
constructor(httpStatusCode) {
|
||||
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
||||
this.httpStatusCode = httpStatusCode;
|
||||
Object.setPrototypeOf(this, new.target.prototype);
|
||||
}
|
||||
};
|
||||
exports2.HTTPError = HTTPError;
|
||||
exports2.HTTPError = HTTPError2;
|
||||
var IS_WINDOWS = process.platform === "win32";
|
||||
var IS_MAC = process.platform === "darwin";
|
||||
var userAgent = "actions/tool-cache";
|
||||
@@ -80945,7 +80945,7 @@ var require_tool_cache = __commonJS({
|
||||
return yield retryHelper.execute(() => __awaiter4(this, void 0, void 0, function* () {
|
||||
return yield downloadToolAttempt(url2, dest || "", auth, headers);
|
||||
}), (err) => {
|
||||
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||
if (err instanceof HTTPError2 && err.httpStatusCode) {
|
||||
if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) {
|
||||
return false;
|
||||
}
|
||||
@@ -80972,7 +80972,7 @@ var require_tool_cache = __commonJS({
|
||||
}
|
||||
const response = yield http.get(url2, headers);
|
||||
if (response.message.statusCode !== 200) {
|
||||
const err = new HTTPError(response.message.statusCode);
|
||||
const err = new HTTPError2(response.message.statusCode);
|
||||
core12.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||
throw err;
|
||||
}
|
||||
@@ -84865,7 +84865,7 @@ var path14 = __toESM(require("path"));
|
||||
var url = __toESM(require("url"));
|
||||
var import_zlib = __toESM(require("zlib"));
|
||||
var core11 = __toESM(require_core());
|
||||
var jsonschema = __toESM(require_lib2());
|
||||
var jsonschema2 = __toESM(require_lib2());
|
||||
|
||||
// src/actions-util.ts
|
||||
var fs4 = __toESM(require("fs"));
|
||||
@@ -88328,13 +88328,28 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
constructor(message, status) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
}
|
||||
};
|
||||
var ConfigurationError = class extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
}
|
||||
};
|
||||
function isHTTPError(arg) {
|
||||
return arg?.status !== void 0 && Number.isInteger(arg.status);
|
||||
function asHTTPError(arg) {
|
||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||
return void 0;
|
||||
}
|
||||
if (Number.isInteger(arg.status)) {
|
||||
return new HTTPError(arg.message, arg.status);
|
||||
}
|
||||
if (Number.isInteger(arg.httpStatusCode)) {
|
||||
return new HTTPError(arg.message, arg.httpStatusCode);
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
var cachedCodeQlVersion = void 0;
|
||||
function cacheCodeQlVersion(version) {
|
||||
@@ -88747,14 +88762,24 @@ function computeAutomationID(analysis_key, environment) {
|
||||
return automationID;
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
if (isHTTPError(e)) {
|
||||
if (e.message.includes("API rate limit exceeded for installation") || e.message.includes("commit not found") || e.message.includes("Resource not accessible by integration") || /ref .* not found in this repository/.test(e.message)) {
|
||||
return new ConfigurationError(e.message);
|
||||
} else if (e.message.includes("Bad credentials") || e.message.includes("Not Found")) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
if ([
|
||||
/API rate limit exceeded/,
|
||||
/commit not found/,
|
||||
/Resource not accessible by integration/,
|
||||
/ref .* not found in this repository/
|
||||
].some((pattern) => pattern.test(httpError.message))) {
|
||||
return new ConfigurationError(httpError.message);
|
||||
}
|
||||
if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) {
|
||||
return new ConfigurationError(
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
@@ -88765,45 +88790,6 @@ var path12 = __toESM(require("path"));
|
||||
var core10 = __toESM(require_core());
|
||||
var toolrunner3 = __toESM(require_toolrunner());
|
||||
|
||||
// node_modules/@octokit/request-error/dist-src/index.js
|
||||
var RequestError = class extends Error {
|
||||
name;
|
||||
/**
|
||||
* http status code
|
||||
*/
|
||||
status;
|
||||
/**
|
||||
* Request options that lead to the error.
|
||||
*/
|
||||
request;
|
||||
/**
|
||||
* Response object if a response was received
|
||||
*/
|
||||
response;
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
this.name = "HttpError";
|
||||
this.status = Number.parseInt(statusCode);
|
||||
if (Number.isNaN(this.status)) {
|
||||
this.status = 0;
|
||||
}
|
||||
if ("response" in options) {
|
||||
this.response = options.response;
|
||||
}
|
||||
const requestCopy = Object.assign({}, options.request);
|
||||
if (options.request.headers.authorization) {
|
||||
requestCopy.headers = Object.assign({}, options.request.headers, {
|
||||
authorization: options.request.headers.authorization.replace(
|
||||
/(?<! ) .*$/,
|
||||
" [REDACTED]"
|
||||
)
|
||||
});
|
||||
}
|
||||
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
||||
this.request = requestCopy;
|
||||
}
|
||||
};
|
||||
|
||||
// src/cli-errors.ts
|
||||
var SUPPORTED_PLATFORMS = [
|
||||
["linux", "x64"],
|
||||
@@ -88971,6 +88957,9 @@ var cliErrorsConfig = {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp(
|
||||
"Query pack .* cannot be found\\. Check the spelling of the pack\\."
|
||||
),
|
||||
new RegExp(
|
||||
"is not a .ql file, .qls file, a directory, or a query pack specification."
|
||||
)
|
||||
]
|
||||
},
|
||||
@@ -89049,6 +89038,7 @@ var path9 = __toESM(require("path"));
|
||||
var core6 = __toESM(require_core());
|
||||
|
||||
// src/config/db-config.ts
|
||||
var jsonschema = __toESM(require_lib2());
|
||||
var semver2 = __toESM(require_semver2());
|
||||
var PACK_IDENTIFIER_PATTERN = (function() {
|
||||
const alphaNumeric = "[a-z0-9]";
|
||||
@@ -89065,8 +89055,8 @@ var path8 = __toESM(require("path"));
|
||||
var semver4 = __toESM(require_semver2());
|
||||
|
||||
// src/defaults.json
|
||||
var bundleVersion = "codeql-bundle-v2.23.2";
|
||||
var cliVersion = "2.23.2";
|
||||
var bundleVersion = "codeql-bundle-v2.23.3";
|
||||
var cliVersion = "2.23.3";
|
||||
|
||||
// src/overlay-database-utils.ts
|
||||
var fs5 = __toESM(require("fs"));
|
||||
@@ -89530,6 +89520,11 @@ var featureConfig = {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS",
|
||||
minimumVersion: "2.23.0"
|
||||
},
|
||||
["validate_db_config" /* ValidateDbConfig */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG",
|
||||
minimumVersion: void 0
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90598,9 +90593,9 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV
|
||||
toolsVersion,
|
||||
zstdAvailability
|
||||
};
|
||||
} catch (e) {
|
||||
const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") || // out of disk space
|
||||
e instanceof RequestError && e.status === 429 ? ConfigurationError : Error;
|
||||
} catch (rawError) {
|
||||
const e = wrapApiConfigurationError(rawError);
|
||||
const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") ? ConfigurationError : Error;
|
||||
throw new ErrorClass(
|
||||
`Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${e instanceof Error && e.stack ? `
|
||||
|
||||
@@ -92520,16 +92515,17 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) {
|
||||
logger.info("Successfully uploaded results");
|
||||
return response.data.id;
|
||||
} catch (e) {
|
||||
if (isHTTPError(e)) {
|
||||
switch (e.status) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
switch (httpError.status) {
|
||||
case 403:
|
||||
core11.warning(e.message || GENERIC_403_MSG);
|
||||
core11.warning(httpError.message || GENERIC_403_MSG);
|
||||
break;
|
||||
case 404:
|
||||
core11.warning(e.message || GENERIC_404_MSG);
|
||||
core11.warning(httpError.message || GENERIC_404_MSG);
|
||||
break;
|
||||
default:
|
||||
core11.warning(e.message);
|
||||
core11.warning(httpError.message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -92651,7 +92647,7 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) {
|
||||
}
|
||||
logger.info(`Validating ${sarifFilePath}`);
|
||||
const schema2 = require_sarif_schema_2_1_0();
|
||||
const result = new jsonschema.Validator().validate(sarif, schema2);
|
||||
const result = new jsonschema2.Validator().validate(sarif, schema2);
|
||||
const warningAttributes = ["uri-reference", "uri"];
|
||||
const errors = (result.errors ?? []).filter(
|
||||
(err) => !(err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument))
|
||||
|
||||
Generated
+1311
-5
File diff suppressed because it is too large
Load Diff
Generated
+112
-114
@@ -20602,14 +20602,14 @@ var require_dist_node4 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -20701,7 +20701,7 @@ var require_dist_node5 = __commonJS({
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error2 = require_dist_node4();
|
||||
var import_request_error = require_dist_node4();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
@@ -20753,7 +20753,7 @@ var require_dist_node5 = __commonJS({
|
||||
if (status < 400) {
|
||||
return;
|
||||
}
|
||||
throw new import_request_error2.RequestError(response.statusText, status, {
|
||||
throw new import_request_error.RequestError(response.statusText, status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -20764,7 +20764,7 @@ var require_dist_node5 = __commonJS({
|
||||
});
|
||||
}
|
||||
if (status === 304) {
|
||||
throw new import_request_error2.RequestError("Not modified", status, {
|
||||
throw new import_request_error.RequestError("Not modified", status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -20776,7 +20776,7 @@ var require_dist_node5 = __commonJS({
|
||||
}
|
||||
if (status >= 400) {
|
||||
const data = await getResponseData(response);
|
||||
const error2 = new import_request_error2.RequestError(toErrorMessage(data), status, {
|
||||
const error2 = new import_request_error.RequestError(toErrorMessage(data), status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -20796,7 +20796,7 @@ var require_dist_node5 = __commonJS({
|
||||
data
|
||||
};
|
||||
}).catch((error2) => {
|
||||
if (error2 instanceof import_request_error2.RequestError)
|
||||
if (error2 instanceof import_request_error.RequestError)
|
||||
throw error2;
|
||||
else if (error2.name === "AbortError")
|
||||
throw error2;
|
||||
@@ -20808,7 +20808,7 @@ var require_dist_node5 = __commonJS({
|
||||
message = error2.cause;
|
||||
}
|
||||
}
|
||||
throw new import_request_error2.RequestError(message, 500, {
|
||||
throw new import_request_error.RequestError(message, 500, {
|
||||
request: requestOptions
|
||||
});
|
||||
});
|
||||
@@ -21250,14 +21250,14 @@ var require_dist_node7 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -21349,7 +21349,7 @@ var require_dist_node8 = __commonJS({
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error2 = require_dist_node7();
|
||||
var import_request_error = require_dist_node7();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
@@ -21401,7 +21401,7 @@ var require_dist_node8 = __commonJS({
|
||||
if (status < 400) {
|
||||
return;
|
||||
}
|
||||
throw new import_request_error2.RequestError(response.statusText, status, {
|
||||
throw new import_request_error.RequestError(response.statusText, status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -21412,7 +21412,7 @@ var require_dist_node8 = __commonJS({
|
||||
});
|
||||
}
|
||||
if (status === 304) {
|
||||
throw new import_request_error2.RequestError("Not modified", status, {
|
||||
throw new import_request_error.RequestError("Not modified", status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -21424,7 +21424,7 @@ var require_dist_node8 = __commonJS({
|
||||
}
|
||||
if (status >= 400) {
|
||||
const data = await getResponseData(response);
|
||||
const error2 = new import_request_error2.RequestError(toErrorMessage(data), status, {
|
||||
const error2 = new import_request_error.RequestError(toErrorMessage(data), status, {
|
||||
response: {
|
||||
url: url2,
|
||||
status,
|
||||
@@ -21444,7 +21444,7 @@ var require_dist_node8 = __commonJS({
|
||||
data
|
||||
};
|
||||
}).catch((error2) => {
|
||||
if (error2 instanceof import_request_error2.RequestError)
|
||||
if (error2 instanceof import_request_error.RequestError)
|
||||
throw error2;
|
||||
else if (error2.name === "AbortError")
|
||||
throw error2;
|
||||
@@ -21456,7 +21456,7 @@ var require_dist_node8 = __commonJS({
|
||||
message = error2.cause;
|
||||
}
|
||||
}
|
||||
throw new import_request_error2.RequestError(message, 500, {
|
||||
throw new import_request_error.RequestError(message, 500, {
|
||||
request: requestOptions
|
||||
});
|
||||
});
|
||||
@@ -32309,7 +32309,7 @@ var require_package = __commonJS({
|
||||
"package.json"(exports2, module2) {
|
||||
module2.exports = {
|
||||
name: "codeql",
|
||||
version: "4.30.9",
|
||||
version: "4.30.10",
|
||||
private: true,
|
||||
description: "CodeQL action",
|
||||
scripts: {
|
||||
@@ -32357,7 +32357,7 @@ var require_package = __commonJS({
|
||||
jsonschema: "1.4.1",
|
||||
long: "^5.3.2",
|
||||
"node-forge": "^1.3.1",
|
||||
octokit: "^5.0.3",
|
||||
octokit: "^5.0.4",
|
||||
semver: "^7.7.3",
|
||||
uuid: "^13.0.0"
|
||||
},
|
||||
@@ -32365,7 +32365,7 @@ var require_package = __commonJS({
|
||||
"@ava/typescript": "6.0.0",
|
||||
"@eslint/compat": "^1.4.0",
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.37.0",
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@octokit/types": "^15.0.0",
|
||||
"@types/archiver": "^6.0.3",
|
||||
@@ -32376,10 +32376,10 @@ var require_package = __commonJS({
|
||||
"@types/node-forge": "^1.3.14",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@types/sinon": "^17.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.41.0",
|
||||
ava: "^6.4.1",
|
||||
esbuild: "^0.25.10",
|
||||
esbuild: "^0.25.11",
|
||||
eslint: "^8.57.1",
|
||||
"eslint-import-resolver-typescript": "^3.8.7",
|
||||
"eslint-plugin-filenames": "^1.3.2",
|
||||
@@ -33768,14 +33768,14 @@ var require_dist_node14 = __commonJS({
|
||||
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
||||
var dist_src_exports = {};
|
||||
__export2(dist_src_exports, {
|
||||
RequestError: () => RequestError2
|
||||
RequestError: () => RequestError
|
||||
});
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_deprecation = require_dist_node3();
|
||||
var import_once = __toESM2(require_once());
|
||||
var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
|
||||
var RequestError2 = class extends Error {
|
||||
var RequestError = class extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
@@ -33877,7 +33877,7 @@ var require_dist_node15 = __commonJS({
|
||||
throw error2;
|
||||
}
|
||||
var import_light = __toESM2(require_light());
|
||||
var import_request_error2 = require_dist_node14();
|
||||
var import_request_error = require_dist_node14();
|
||||
async function wrapRequest(state, octokit, request, options) {
|
||||
const limiter = new import_light.default();
|
||||
limiter.on("failed", function(error2, info4) {
|
||||
@@ -33898,7 +33898,7 @@ var require_dist_node15 = __commonJS({
|
||||
if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(
|
||||
response.data.errors[0].message
|
||||
)) {
|
||||
const error2 = new import_request_error2.RequestError(response.data.errors[0].message, 500, {
|
||||
const error2 = new import_request_error.RequestError(response.data.errors[0].message, 500, {
|
||||
request: options,
|
||||
response
|
||||
});
|
||||
@@ -80374,19 +80374,19 @@ var require_validator2 = __commonJS({
|
||||
var SchemaError = helpers.SchemaError;
|
||||
var SchemaContext = helpers.SchemaContext;
|
||||
var anonymousBase = "/";
|
||||
var Validator2 = function Validator3() {
|
||||
this.customFormats = Object.create(Validator3.prototype.customFormats);
|
||||
var Validator3 = function Validator4() {
|
||||
this.customFormats = Object.create(Validator4.prototype.customFormats);
|
||||
this.schemas = {};
|
||||
this.unresolvedRefs = [];
|
||||
this.types = Object.create(types);
|
||||
this.attributes = Object.create(attribute.validators);
|
||||
};
|
||||
Validator2.prototype.customFormats = {};
|
||||
Validator2.prototype.schemas = null;
|
||||
Validator2.prototype.types = null;
|
||||
Validator2.prototype.attributes = null;
|
||||
Validator2.prototype.unresolvedRefs = null;
|
||||
Validator2.prototype.addSchema = function addSchema(schema2, base) {
|
||||
Validator3.prototype.customFormats = {};
|
||||
Validator3.prototype.schemas = null;
|
||||
Validator3.prototype.types = null;
|
||||
Validator3.prototype.attributes = null;
|
||||
Validator3.prototype.unresolvedRefs = null;
|
||||
Validator3.prototype.addSchema = function addSchema(schema2, base) {
|
||||
var self2 = this;
|
||||
if (!schema2) {
|
||||
return null;
|
||||
@@ -80404,25 +80404,25 @@ var require_validator2 = __commonJS({
|
||||
});
|
||||
return this.schemas[ourUri];
|
||||
};
|
||||
Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) {
|
||||
Validator3.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) {
|
||||
if (!Array.isArray(schemas)) return;
|
||||
for (var i = 0; i < schemas.length; i++) {
|
||||
this.addSubSchema(baseuri, schemas[i]);
|
||||
}
|
||||
};
|
||||
Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) {
|
||||
Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) {
|
||||
if (!schemas || typeof schemas != "object") return;
|
||||
for (var p in schemas) {
|
||||
this.addSubSchema(baseuri, schemas[p]);
|
||||
}
|
||||
};
|
||||
Validator2.prototype.setSchemas = function setSchemas(schemas) {
|
||||
Validator3.prototype.setSchemas = function setSchemas(schemas) {
|
||||
this.schemas = schemas;
|
||||
};
|
||||
Validator2.prototype.getSchema = function getSchema(urn) {
|
||||
Validator3.prototype.getSchema = function getSchema(urn) {
|
||||
return this.schemas[urn];
|
||||
};
|
||||
Validator2.prototype.validate = function validate(instance, schema2, options, ctx) {
|
||||
Validator3.prototype.validate = function validate(instance, schema2, options, ctx) {
|
||||
if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) {
|
||||
throw new SchemaError("Expected `schema` to be an object or boolean");
|
||||
}
|
||||
@@ -80460,7 +80460,7 @@ var require_validator2 = __commonJS({
|
||||
if (typeof ref == "string") return ref;
|
||||
return false;
|
||||
}
|
||||
Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) {
|
||||
Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) {
|
||||
var result = new ValidatorResult(instance, schema2, options, ctx);
|
||||
if (typeof schema2 === "boolean") {
|
||||
if (schema2 === true) {
|
||||
@@ -80510,17 +80510,17 @@ var require_validator2 = __commonJS({
|
||||
}
|
||||
return result;
|
||||
};
|
||||
Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) {
|
||||
Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) {
|
||||
schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx));
|
||||
};
|
||||
Validator2.prototype.superResolve = function superResolve(schema2, ctx) {
|
||||
Validator3.prototype.superResolve = function superResolve(schema2, ctx) {
|
||||
var ref = shouldResolve(schema2);
|
||||
if (ref) {
|
||||
return this.resolve(schema2, ref, ctx).subschema;
|
||||
}
|
||||
return schema2;
|
||||
};
|
||||
Validator2.prototype.resolve = function resolve6(schema2, switchSchema, ctx) {
|
||||
Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) {
|
||||
switchSchema = ctx.resolve(switchSchema);
|
||||
if (ctx.schemas[switchSchema]) {
|
||||
return { subschema: ctx.schemas[switchSchema], switchSchema };
|
||||
@@ -80537,7 +80537,7 @@ var require_validator2 = __commonJS({
|
||||
}
|
||||
return { subschema, switchSchema };
|
||||
};
|
||||
Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) {
|
||||
Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) {
|
||||
if (type2 === void 0) {
|
||||
return;
|
||||
} else if (type2 === null) {
|
||||
@@ -80552,7 +80552,7 @@ var require_validator2 = __commonJS({
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var types = Validator2.prototype.types = {};
|
||||
var types = Validator3.prototype.types = {};
|
||||
types.string = function testString(instance) {
|
||||
return typeof instance == "string";
|
||||
};
|
||||
@@ -80580,7 +80580,7 @@ var require_validator2 = __commonJS({
|
||||
types.object = function testObject(instance) {
|
||||
return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date);
|
||||
};
|
||||
module2.exports = Validator2;
|
||||
module2.exports = Validator3;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80588,7 +80588,7 @@ var require_validator2 = __commonJS({
|
||||
var require_lib2 = __commonJS({
|
||||
"node_modules/jsonschema/lib/index.js"(exports2, module2) {
|
||||
"use strict";
|
||||
var Validator2 = module2.exports.Validator = require_validator2();
|
||||
var Validator3 = module2.exports.Validator = require_validator2();
|
||||
module2.exports.ValidatorResult = require_helpers3().ValidatorResult;
|
||||
module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError;
|
||||
module2.exports.ValidationError = require_helpers3().ValidationError;
|
||||
@@ -80596,7 +80596,7 @@ var require_lib2 = __commonJS({
|
||||
module2.exports.SchemaScanResult = require_scan2().SchemaScanResult;
|
||||
module2.exports.scan = require_scan2().scan;
|
||||
module2.exports.validate = function(instance, schema2, options) {
|
||||
var v = new Validator2();
|
||||
var v = new Validator3();
|
||||
return v.validate(instance, schema2, options);
|
||||
};
|
||||
}
|
||||
@@ -80921,14 +80921,14 @@ var require_tool_cache = __commonJS({
|
||||
var assert_1 = require("assert");
|
||||
var exec_1 = require_exec();
|
||||
var retry_helper_1 = require_retry_helper();
|
||||
var HTTPError = class extends Error {
|
||||
var HTTPError2 = class extends Error {
|
||||
constructor(httpStatusCode) {
|
||||
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
||||
this.httpStatusCode = httpStatusCode;
|
||||
Object.setPrototypeOf(this, new.target.prototype);
|
||||
}
|
||||
};
|
||||
exports2.HTTPError = HTTPError;
|
||||
exports2.HTTPError = HTTPError2;
|
||||
var IS_WINDOWS = process.platform === "win32";
|
||||
var IS_MAC = process.platform === "darwin";
|
||||
var userAgent = "actions/tool-cache";
|
||||
@@ -80945,7 +80945,7 @@ var require_tool_cache = __commonJS({
|
||||
return yield retryHelper.execute(() => __awaiter4(this, void 0, void 0, function* () {
|
||||
return yield downloadToolAttempt(url2, dest || "", auth, headers);
|
||||
}), (err) => {
|
||||
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||
if (err instanceof HTTPError2 && err.httpStatusCode) {
|
||||
if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) {
|
||||
return false;
|
||||
}
|
||||
@@ -80972,7 +80972,7 @@ var require_tool_cache = __commonJS({
|
||||
}
|
||||
const response = yield http.get(url2, headers);
|
||||
if (response.message.statusCode !== 200) {
|
||||
const err = new HTTPError(response.message.statusCode);
|
||||
const err = new HTTPError2(response.message.statusCode);
|
||||
core14.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||
throw err;
|
||||
}
|
||||
@@ -88444,13 +88444,28 @@ function getRequiredEnvParam(paramName) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
var HTTPError = class extends Error {
|
||||
constructor(message, status) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
}
|
||||
};
|
||||
var ConfigurationError = class extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
}
|
||||
};
|
||||
function isHTTPError(arg) {
|
||||
return arg?.status !== void 0 && Number.isInteger(arg.status);
|
||||
function asHTTPError(arg) {
|
||||
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
|
||||
return void 0;
|
||||
}
|
||||
if (Number.isInteger(arg.status)) {
|
||||
return new HTTPError(arg.message, arg.status);
|
||||
}
|
||||
if (Number.isInteger(arg.httpStatusCode)) {
|
||||
return new HTTPError(arg.message, arg.httpStatusCode);
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
var cachedCodeQlVersion = void 0;
|
||||
function cacheCodeQlVersion(version) {
|
||||
@@ -88958,14 +88973,24 @@ function computeAutomationID(analysis_key, environment) {
|
||||
return automationID;
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
if (isHTTPError(e)) {
|
||||
if (e.message.includes("API rate limit exceeded for installation") || e.message.includes("commit not found") || e.message.includes("Resource not accessible by integration") || /ref .* not found in this repository/.test(e.message)) {
|
||||
return new ConfigurationError(e.message);
|
||||
} else if (e.message.includes("Bad credentials") || e.message.includes("Not Found")) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
if ([
|
||||
/API rate limit exceeded/,
|
||||
/commit not found/,
|
||||
/Resource not accessible by integration/,
|
||||
/ref .* not found in this repository/
|
||||
].some((pattern) => pattern.test(httpError.message))) {
|
||||
return new ConfigurationError(httpError.message);
|
||||
}
|
||||
if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) {
|
||||
return new ConfigurationError(
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
@@ -88976,8 +89001,8 @@ var path8 = __toESM(require("path"));
|
||||
var semver3 = __toESM(require_semver2());
|
||||
|
||||
// src/defaults.json
|
||||
var bundleVersion = "codeql-bundle-v2.23.2";
|
||||
var cliVersion = "2.23.2";
|
||||
var bundleVersion = "codeql-bundle-v2.23.3";
|
||||
var cliVersion = "2.23.3";
|
||||
|
||||
// src/overlay-database-utils.ts
|
||||
var fs5 = __toESM(require("fs"));
|
||||
@@ -89446,6 +89471,11 @@ var featureConfig = {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS",
|
||||
minimumVersion: "2.23.0"
|
||||
},
|
||||
["validate_db_config" /* ValidateDbConfig */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG",
|
||||
minimumVersion: void 0
|
||||
}
|
||||
};
|
||||
var FEATURE_FLAGS_FILE_NAME = "cached-feature-flags.json";
|
||||
@@ -89698,9 +89728,10 @@ var GitHubFeatureFlags = class {
|
||||
this.hasAccessedRemoteFeatureFlags = true;
|
||||
return remoteFlags;
|
||||
} catch (e) {
|
||||
if (isHTTPError(e) && e.status === 403) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError?.status === 403) {
|
||||
this.logger.warning(
|
||||
`This run of the CodeQL Action does not have permission to access Code Scanning API endpoints. As a result, it will not be opted into any experimental features. This could be because the Action is running on a pull request from a fork. If not, please ensure the Action has the 'security-events: write' permission. Details: ${e.message}`
|
||||
`This run of the CodeQL Action does not have permission to access Code Scanning API endpoints. As a result, it will not be opted into any experimental features. This could be because the Action is running on a pull request from a fork. If not, please ensure the Action has the 'security-events: write' permission. Details: ${httpError.message}`
|
||||
);
|
||||
this.hasAccessedRemoteFeatureFlags = false;
|
||||
return {};
|
||||
@@ -89725,6 +89756,7 @@ var path10 = __toESM(require("path"));
|
||||
var core8 = __toESM(require_core());
|
||||
|
||||
// src/config/db-config.ts
|
||||
var jsonschema = __toESM(require_lib2());
|
||||
var semver4 = __toESM(require_semver2());
|
||||
var PACK_IDENTIFIER_PATTERN = (function() {
|
||||
const alphaNumeric = "[a-z0-9]";
|
||||
@@ -89972,19 +90004,20 @@ async function sendStatusReport(statusReport) {
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
if (isHTTPError(e)) {
|
||||
switch (e.status) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
switch (httpError.status) {
|
||||
case 403:
|
||||
if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") {
|
||||
core9.warning(
|
||||
`Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading Code Scanning results requires write access. To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.`
|
||||
);
|
||||
} else {
|
||||
core9.warning(e.message);
|
||||
core9.warning(httpError.message);
|
||||
}
|
||||
return;
|
||||
case 404:
|
||||
core9.warning(e.message);
|
||||
core9.warning(httpError.message);
|
||||
return;
|
||||
case 422:
|
||||
if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) {
|
||||
@@ -90009,7 +90042,7 @@ var path15 = __toESM(require("path"));
|
||||
var url = __toESM(require("url"));
|
||||
var import_zlib = __toESM(require("zlib"));
|
||||
var core12 = __toESM(require_core());
|
||||
var jsonschema = __toESM(require_lib2());
|
||||
var jsonschema2 = __toESM(require_lib2());
|
||||
|
||||
// src/codeql.ts
|
||||
var fs12 = __toESM(require("fs"));
|
||||
@@ -90017,45 +90050,6 @@ var path13 = __toESM(require("path"));
|
||||
var core11 = __toESM(require_core());
|
||||
var toolrunner3 = __toESM(require_toolrunner());
|
||||
|
||||
// node_modules/@octokit/request-error/dist-src/index.js
|
||||
var RequestError = class extends Error {
|
||||
name;
|
||||
/**
|
||||
* http status code
|
||||
*/
|
||||
status;
|
||||
/**
|
||||
* Request options that lead to the error.
|
||||
*/
|
||||
request;
|
||||
/**
|
||||
* Response object if a response was received
|
||||
*/
|
||||
response;
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
this.name = "HttpError";
|
||||
this.status = Number.parseInt(statusCode);
|
||||
if (Number.isNaN(this.status)) {
|
||||
this.status = 0;
|
||||
}
|
||||
if ("response" in options) {
|
||||
this.response = options.response;
|
||||
}
|
||||
const requestCopy = Object.assign({}, options.request);
|
||||
if (options.request.headers.authorization) {
|
||||
requestCopy.headers = Object.assign({}, options.request.headers, {
|
||||
authorization: options.request.headers.authorization.replace(
|
||||
/(?<! ) .*$/,
|
||||
" [REDACTED]"
|
||||
)
|
||||
});
|
||||
}
|
||||
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
||||
this.request = requestCopy;
|
||||
}
|
||||
};
|
||||
|
||||
// src/cli-errors.ts
|
||||
var SUPPORTED_PLATFORMS = [
|
||||
["linux", "x64"],
|
||||
@@ -90223,6 +90217,9 @@ var cliErrorsConfig = {
|
||||
cliErrorMessageCandidates: [
|
||||
new RegExp(
|
||||
"Query pack .* cannot be found\\. Check the spelling of the pack\\."
|
||||
),
|
||||
new RegExp(
|
||||
"is not a .ql file, .qls file, a directory, or a query pack specification."
|
||||
)
|
||||
]
|
||||
},
|
||||
@@ -91269,9 +91266,9 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV
|
||||
toolsVersion,
|
||||
zstdAvailability
|
||||
};
|
||||
} catch (e) {
|
||||
const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") || // out of disk space
|
||||
e instanceof RequestError && e.status === 429 ? ConfigurationError : Error;
|
||||
} catch (rawError) {
|
||||
const e = wrapApiConfigurationError(rawError);
|
||||
const ErrorClass = e instanceof ConfigurationError || e instanceof Error && e.message.includes("ENOSPC") ? ConfigurationError : Error;
|
||||
throw new ErrorClass(
|
||||
`Unable to download and extract CodeQL CLI: ${getErrorMessage(e)}${e instanceof Error && e.stack ? `
|
||||
|
||||
@@ -93191,16 +93188,17 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) {
|
||||
logger.info("Successfully uploaded results");
|
||||
return response.data.id;
|
||||
} catch (e) {
|
||||
if (isHTTPError(e)) {
|
||||
switch (e.status) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
switch (httpError.status) {
|
||||
case 403:
|
||||
core12.warning(e.message || GENERIC_403_MSG);
|
||||
core12.warning(httpError.message || GENERIC_403_MSG);
|
||||
break;
|
||||
case 404:
|
||||
core12.warning(e.message || GENERIC_404_MSG);
|
||||
core12.warning(httpError.message || GENERIC_404_MSG);
|
||||
break;
|
||||
default:
|
||||
core12.warning(e.message);
|
||||
core12.warning(httpError.message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -93305,7 +93303,7 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) {
|
||||
}
|
||||
logger.info(`Validating ${sarifFilePath}`);
|
||||
const schema2 = require_sarif_schema_2_1_0();
|
||||
const result = new jsonschema.Validator().validate(sarif, schema2);
|
||||
const result = new jsonschema2.Validator().validate(sarif, schema2);
|
||||
const warningAttributes = ["uri-reference", "uri"];
|
||||
const errors = (result.errors ?? []).filter(
|
||||
(err) => !(err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument))
|
||||
|
||||
Reference in New Issue
Block a user