diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index bfb1b26a7..ca8b16fc1 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path9, name, argument) { if (Array.isArray(path9)) { this.path = path9; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path9 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path9, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -161584,6 +161592,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -161640,8 +161653,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -161654,8 +161670,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info7) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -161667,7 +161683,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -161689,11 +161705,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -161704,6 +161716,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; diff --git a/lib/analyze-action.js b/lib/analyze-action.js index a55e5923b..d6499da8e 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path16, name, argument) { if (Array.isArray(path16)) { this.path = path16; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve8(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path16 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path16, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash: hash2 } = resolvedUrl; + return pathname + search + hash2; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -106452,6 +106460,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -106818,6 +106827,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -106975,8 +106989,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -106989,8 +107006,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -107002,7 +107019,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -107024,11 +107041,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -107039,6 +107052,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -108201,6 +108219,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -108349,6 +108368,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. @@ -110611,6 +110633,9 @@ var CodeQLAnalysisError = class extends Error { this.error = error3; this.name = "CodeQLAnalysisError"; } + queriesStatusReport; + message; + error; }; async function setupPythonExtractor(logger) { const codeqlPython = process.env["CODEQL_PYTHON"]; diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 72914e72c..5c9369962 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path9, name, argument) { if (Array.isArray(path9)) { this.path = path9; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path9 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path9, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -103591,6 +103599,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -103638,8 +103651,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -103652,8 +103668,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -103665,7 +103681,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -103687,11 +103703,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -103702,6 +103714,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -104659,6 +104676,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -104807,6 +104825,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 1208243d4..67451b702 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path19, name, argument) { if (Array.isArray(path19)) { this.path = path19; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve8(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path19 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path19, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash: hash2 } = resolvedUrl; + return pathname + search + hash2; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -164394,6 +164402,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -164612,6 +164621,7 @@ var Success = class { constructor(value) { this.value = value; } + value; isSuccess() { return true; } @@ -164626,6 +164636,7 @@ var Failure = class { constructor(value) { this.value = value; } + value; isSuccess() { return false; } @@ -164786,6 +164797,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -164866,8 +164882,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -164880,8 +164899,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info7) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -164893,7 +164912,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -164915,11 +164934,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -164930,6 +164945,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -166122,6 +166142,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -166270,6 +166291,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. diff --git a/lib/init-action.js b/lib/init-action.js index a3acfdaf2..f1634c88b 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path18, name, argument) { if (Array.isArray(path18)) { this.path = path18; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve9(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path18 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path18, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -103796,6 +103804,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -104040,6 +104049,7 @@ var Success = class { constructor(value) { this.value = value; } + value; isSuccess() { return true; } @@ -104054,6 +104064,7 @@ var Failure = class { constructor(value) { this.value = value; } + value; isSuccess() { return false; } @@ -104204,6 +104215,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -104345,8 +104361,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -104359,8 +104378,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -104372,7 +104391,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -104394,11 +104413,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -104409,6 +104424,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -105210,6 +105230,8 @@ var GitVersionInfo = class { this.truncatedVersion = truncatedVersion; this.fullVersion = fullVersion; } + truncatedVersion; + fullVersion; isAtLeast(minVersion) { return semver3.gte(this.truncatedVersion, minVersion); } @@ -105764,6 +105786,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -105912,6 +105935,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index fe8de8a44..50c18e8ae 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path7, name, argument) { if (Array.isArray(path7)) { this.path = path7; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve5(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path7 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path7, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -103599,6 +103607,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -103646,8 +103659,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -103660,8 +103676,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -103673,7 +103689,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -103695,11 +103711,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -103710,6 +103722,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 278e74fd5..847757a25 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path10, name, argument) { if (Array.isArray(path10)) { this.path = path10; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve4(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path10 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path10, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -103444,6 +103452,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -103707,6 +103716,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -103754,8 +103768,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -103768,8 +103785,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -103781,7 +103798,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -103803,11 +103820,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -103818,6 +103831,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -104510,6 +104528,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -104658,6 +104677,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 60b32299c..3c9dcf5e5 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path4, name, argument) { if (Array.isArray(path4)) { this.path = path4; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve3(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path4 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path4, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -161518,8 +161526,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -161532,8 +161543,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info7) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -161545,7 +161556,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -161567,11 +161578,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -161582,6 +161589,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index dd297ba50..0a64ac214 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -48126,7 +48126,6 @@ var require_tool_cache = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path5, name, argument) { if (Array.isArray(path5)) { this.path = path5; @@ -48201,7 +48200,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -48216,7 +48215,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -48240,12 +48241,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve2(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path5 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path5, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -48439,6 +48440,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -49114,7 +49123,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -49125,12 +49133,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -49182,7 +49191,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -49247,7 +49255,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -49342,8 +49350,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -120772,8 +120780,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -120786,8 +120797,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request3, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -120799,7 +120810,7 @@ async function wrapRequest(state, octokit, request3, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request3, options) { - const response = await request3(request3, options); + const response = await request3(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -120821,11 +120832,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -120836,6 +120843,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -121291,6 +121303,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -121439,6 +121452,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry. @@ -122651,12 +122667,14 @@ var ReachabilityError = class extends Error { super(); this.statusCode = statusCode; } + statusCode; }; var NetworkReachabilityBackend = class { constructor(proxy) { this.proxy = proxy; this.agent = new import_https_proxy_agent.HttpsProxyAgent(`http://${proxy.host}:${proxy.port}`); } + proxy; agent; async checkConnection(url) { return new Promise((resolve2, reject) => { diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 49bdc6f3c..7fed483bf 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -21494,7 +21494,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path12, name, argument) { if (Array.isArray(path12)) { this.path = path12; @@ -21569,7 +21568,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -21584,7 +21583,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -21608,12 +21609,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path12 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path12, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -21807,6 +21808,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash: hash2 } = resolvedUrl; + return pathname + search + hash2; + } + return resolvedUrl.toString(); + }; } }); @@ -22482,7 +22491,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -22493,12 +22501,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -22550,7 +22559,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -22615,7 +22623,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -22710,8 +22718,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -106275,6 +106283,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -106503,6 +106512,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -106633,8 +106647,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -106647,8 +106664,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -106660,7 +106677,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -106682,11 +106699,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -106697,6 +106710,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index ca7a909ea..955291ece 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -149550,7 +149550,6 @@ var require_artifact_client2 = __commonJS({ var require_helpers3 = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path3, name, argument) { if (Array.isArray(path3)) { this.path = path3; @@ -149625,7 +149624,7 @@ var require_helpers3 = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -149640,7 +149639,9 @@ var require_helpers3 = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -149664,12 +149665,12 @@ var require_helpers3 = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve2(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path3 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path3, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -149863,6 +149864,14 @@ var require_helpers3 = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash } = resolvedUrl; + return pathname + search + hash; + } + return resolvedUrl.toString(); + }; } }); @@ -150538,7 +150547,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers3(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -150549,12 +150557,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -150606,7 +150615,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers3(); var scanSchema = require_scan().scan; @@ -150671,7 +150679,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -150766,8 +150774,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -161518,8 +161526,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -161532,8 +161543,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info7) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -161545,7 +161556,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -161567,11 +161578,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -161582,6 +161589,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 037e79dd1..ae2184461 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -47304,7 +47304,6 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var uri = require("url"); var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path13, name, argument) { if (Array.isArray(path13)) { this.path = path13; @@ -47379,7 +47378,7 @@ var require_helpers = __commonJS({ } }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result) { - if (Error.captureStackTrace) { + if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result.instance; @@ -47394,7 +47393,9 @@ var require_helpers = __commonJS({ this.message = msg; this.schema = schema2; Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, SchemaError2); + } }; SchemaError.prototype = Object.create( Error.prototype, @@ -47418,12 +47419,12 @@ var require_helpers = __commonJS({ this.schemas = schemas; }; SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); + return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { var path13 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); + let base = (() => resolveUrl(this.base, id || ""))(); var ctx = new SchemaContext(schema2, this.options, path13, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; @@ -47617,6 +47618,14 @@ var require_helpers = __commonJS({ exports2.isSchema = function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }; + var resolveUrl = exports2.resolveUrl = function resolveUrl2(from, to) { + const resolvedUrl = new URL(to, new URL(from, "resolve://")); + if (resolvedUrl.protocol === "resolve:") { + const { pathname, search, hash: hash2 } = resolvedUrl; + return pathname + search + hash2; + } + return resolvedUrl.toString(); + }; } }); @@ -48292,7 +48301,6 @@ var require_attribute = __commonJS({ var require_scan = __commonJS({ "node_modules/jsonschema/lib/scan.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var helpers = require_helpers(); module2.exports.SchemaScanResult = SchemaScanResult; function SchemaScanResult(found, ref) { @@ -48303,12 +48311,13 @@ var require_scan = __commonJS({ function scanSchema(baseuri, schema3) { if (!schema3 || typeof schema3 != "object") return; if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + let resolvedUri = helpers.resolveUrl(baseuri, schema3.$ref); ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; return; } var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + let resolvedBase = helpers.resolveUrl(baseuri, id); + var ourBase = id ? resolvedBase : baseuri; if (ourBase) { if (ourBase.indexOf("#") < 0) ourBase += "#"; if (found[ourBase]) { @@ -48360,7 +48369,6 @@ var require_scan = __commonJS({ var require_validator = __commonJS({ "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var urilib = require("url"); var attribute = require_attribute(); var helpers = require_helpers(); var scanSchema = require_scan().scan; @@ -48425,7 +48433,7 @@ var require_validator = __commonJS({ options = {}; } var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); + let base = helpers.resolveUrl(options.base, id || ""); if (!ctx) { ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { @@ -48520,8 +48528,8 @@ var require_validator = __commonJS({ if (ctx.schemas[switchSchema]) { return { subschema: ctx.schemas[switchSchema], switchSchema }; } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && parsed.hash; + let parsed = new URL(switchSchema, "thismessage::/"); + let fragment = parsed.hash; var document2 = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length); if (!document2 || !ctx.schemas[document2]) { throw new SchemaError("no such schema <" + switchSchema + ">", schema2); @@ -106249,6 +106257,7 @@ var ExhaustivityCheckingError = class extends Error { super("Internal error: exhaustivity checking failure"); this.expectedExhaustiveValue = expectedExhaustiveValue; } + expectedExhaustiveValue; }; function assertNever(value) { throw new ExhaustivityCheckingError(value); @@ -106534,6 +106543,11 @@ var CommandInvocationError = class extends Error { this.stderr = stderr; this.stdout = stdout; } + cmd; + args; + exitCode; + stderr; + stdout; }; function ensureEndsInPeriod(text) { return text[text.length - 1] === "." ? text : `${text}.`; @@ -106681,8 +106695,11 @@ var githubUtils = __toESM(require_utils5()); var import_light = __toESM(require_light(), 1); init_dist_src(); var VERSION7 = "0.0.0-development"; +function isRequestError(error3) { + return error3.request !== void 0; +} async function errorRequest(state, octokit, error3, options) { - if (!error3.request || !error3.request.request) { + if (!isRequestError(error3) || !error3?.request.request) { throw error3; } if (error3.status >= 400 && !state.doNotRetry.includes(error3.status)) { @@ -106695,8 +106712,8 @@ async function errorRequest(state, octokit, error3, options) { async function wrapRequest(state, octokit, request2, options) { const limiter = new import_light.default(); limiter.on("failed", function(error3, info6) { - const maxRetries = ~~error3.request.request.retries; - const after = ~~error3.request.request.retryAfter; + const maxRetries = ~~error3.request.request?.retries; + const after = ~~error3.request.request?.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -106708,7 +106725,7 @@ async function wrapRequest(state, octokit, request2, options) { ); } async function requestWithGraphqlErrorHandling(state, octokit, request2, options) { - const response = await request2(request2, options); + const response = await request2(options); if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message )) { @@ -106730,11 +106747,7 @@ function retry(octokit, octokitOptions) { }, octokitOptions.retry ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); - } - return { + const retryPlugin = { retry: { retryRequest: (error3, retries, retryAfter) => { error3.request.request = Object.assign({}, error3.request.request, { @@ -106745,6 +106758,11 @@ function retry(octokit, octokitOptions) { } } }; + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin)); + } + return retryPlugin; } retry.VERSION = VERSION7; @@ -107485,6 +107503,7 @@ var OfflineFeatures = class { constructor(logger) { this.logger = logger; } + logger; async getDefaultCliVersion(_variant) { return { cliVersion, @@ -107633,6 +107652,9 @@ var GitHubFeatureFlags = class { this.logger = logger; this.hasAccessedRemoteFeatureFlags = false; } + repositoryNwo; + featureFlagsFile; + logger; cachedApiResponse; // We cache whether the feature flags were accessed or not in order to accurately report whether flags were // incorrectly configured vs. inaccessible in our telemetry.