@cloudsnorkel/cdk-github-runners 0.14.23 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +5397 -252
- package/API.md +1048 -24
- package/README.md +52 -0
- package/assets/delete-failed-runner.lambda/index.js +105 -9
- package/assets/idle-runner-repear.lambda/index.js +136 -14
- package/assets/image-builders/aws-image-builder/delete-resources.lambda/index.js +1 -1
- package/assets/image-builders/build-image.lambda/index.js +1 -1
- package/assets/providers/ami-root-device.lambda/index.js +1 -1
- package/assets/setup.lambda/index.html +7 -7
- package/assets/setup.lambda/index.js +101 -8
- package/assets/status.lambda/index.js +104 -8
- package/assets/token-retriever.lambda/index.js +104 -8
- package/assets/warm-runner-manager.lambda/index.js +5892 -0
- package/assets/webhook-handler.lambda/index.js +109 -11
- package/assets/webhook-redelivery.lambda/index.js +122 -24
- package/lib/access.js +1 -1
- package/lib/delete-failed-runner.lambda.js +2 -2
- package/lib/idle-runner-repear.lambda.js +33 -7
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/base-image.d.ts +13 -0
- package/lib/image-builders/aws-image-builder/base-image.js +36 -3
- package/lib/image-builders/aws-image-builder/builder.js +4 -4
- package/lib/image-builders/aws-image-builder/delete-resources.lambda.js +2 -2
- package/lib/image-builders/aws-image-builder/deprecated/ami.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/container.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
- package/lib/image-builders/build-image.lambda.js +2 -2
- package/lib/image-builders/codebuild-deprecated.js +1 -1
- package/lib/image-builders/components.js +3 -3
- package/lib/image-builders/static.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/lambda-github.d.ts +1 -1
- package/lib/lambda-github.js +3 -2
- package/lib/lambda-helpers.js +4 -4
- package/lib/providers/ami-root-device.lambda.js +2 -2
- package/lib/providers/codebuild.d.ts +16 -0
- package/lib/providers/codebuild.js +16 -5
- package/lib/providers/common.js +3 -3
- package/lib/providers/composite.js +1 -1
- package/lib/providers/ec2.d.ts +5 -0
- package/lib/providers/ec2.js +42 -29
- package/lib/providers/ecs.d.ts +17 -0
- package/lib/providers/ecs.js +43 -38
- package/lib/providers/fargate.js +10 -32
- package/lib/providers/lambda.js +2 -2
- package/lib/runner.d.ts +25 -2
- package/lib/runner.js +119 -17
- package/lib/secrets.js +1 -1
- package/lib/setup.lambda.js +2 -2
- package/lib/utils.d.ts +10 -1
- package/lib/utils.js +15 -1
- package/lib/warm-runner-manager-function.d.ts +18 -0
- package/lib/warm-runner-manager-function.js +24 -0
- package/lib/warm-runner-manager.lambda.d.ts +41 -0
- package/lib/warm-runner-manager.lambda.js +487 -0
- package/lib/warm-runner.d.ts +147 -0
- package/lib/warm-runner.js +210 -0
- package/lib/webhook-handler.lambda.js +5 -3
- package/lib/webhook-redelivery.lambda.js +17 -16
- package/lib/webhook.d.ts +4 -0
- package/lib/webhook.js +2 -1
- package/node_modules/cron-parser/LICENSE +21 -0
- package/node_modules/cron-parser/README.md +408 -0
- package/node_modules/cron-parser/dist/CronDate.js +518 -0
- package/node_modules/cron-parser/dist/CronExpression.js +520 -0
- package/node_modules/cron-parser/dist/CronExpressionParser.js +382 -0
- package/node_modules/cron-parser/dist/CronFieldCollection.js +371 -0
- package/node_modules/cron-parser/dist/CronFileParser.js +109 -0
- package/node_modules/cron-parser/dist/fields/CronDayOfMonth.js +44 -0
- package/node_modules/cron-parser/dist/fields/CronDayOfWeek.js +51 -0
- package/node_modules/cron-parser/dist/fields/CronField.js +214 -0
- package/node_modules/cron-parser/dist/fields/CronHour.js +40 -0
- package/node_modules/cron-parser/dist/fields/CronMinute.js +40 -0
- package/node_modules/cron-parser/dist/fields/CronMonth.js +44 -0
- package/node_modules/cron-parser/dist/fields/CronSecond.js +40 -0
- package/node_modules/cron-parser/dist/fields/index.js +24 -0
- package/node_modules/cron-parser/dist/fields/types.js +2 -0
- package/node_modules/cron-parser/dist/index.js +31 -0
- package/node_modules/cron-parser/dist/types/CronDate.d.ts +288 -0
- package/node_modules/cron-parser/dist/types/CronExpression.d.ts +118 -0
- package/node_modules/cron-parser/dist/types/CronExpressionParser.d.ts +70 -0
- package/node_modules/cron-parser/dist/types/CronFieldCollection.d.ts +153 -0
- package/node_modules/cron-parser/dist/types/CronFileParser.d.ts +30 -0
- package/node_modules/cron-parser/dist/types/fields/CronDayOfMonth.d.ts +25 -0
- package/node_modules/cron-parser/dist/types/fields/CronDayOfWeek.d.ts +30 -0
- package/node_modules/cron-parser/dist/types/fields/CronField.d.ts +130 -0
- package/node_modules/cron-parser/dist/types/fields/CronHour.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/CronMinute.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/CronMonth.d.ts +24 -0
- package/node_modules/cron-parser/dist/types/fields/CronSecond.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/index.d.ts +8 -0
- package/node_modules/cron-parser/dist/types/fields/types.d.ts +18 -0
- package/node_modules/cron-parser/dist/types/index.d.ts +8 -0
- package/node_modules/cron-parser/dist/types/utils/random.d.ts +10 -0
- package/node_modules/cron-parser/dist/utils/random.js +38 -0
- package/node_modules/cron-parser/package.json +117 -0
- package/node_modules/luxon/LICENSE.md +7 -0
- package/node_modules/luxon/README.md +55 -0
- package/node_modules/luxon/build/amd/luxon.js +8741 -0
- package/node_modules/luxon/build/amd/luxon.js.map +1 -0
- package/node_modules/luxon/build/cjs-browser/luxon.js +8739 -0
- package/node_modules/luxon/build/cjs-browser/luxon.js.map +1 -0
- package/node_modules/luxon/build/es6/luxon.mjs +8133 -0
- package/node_modules/luxon/build/es6/luxon.mjs.map +1 -0
- package/node_modules/luxon/build/global/luxon.js +8744 -0
- package/node_modules/luxon/build/global/luxon.js.map +1 -0
- package/node_modules/luxon/build/global/luxon.min.js +1 -0
- package/node_modules/luxon/build/global/luxon.min.js.map +1 -0
- package/node_modules/luxon/build/node/luxon.js +7792 -0
- package/node_modules/luxon/build/node/luxon.js.map +1 -0
- package/node_modules/luxon/package.json +87 -0
- package/node_modules/luxon/src/datetime.js +2603 -0
- package/node_modules/luxon/src/duration.js +1009 -0
- package/node_modules/luxon/src/errors.js +61 -0
- package/node_modules/luxon/src/impl/conversions.js +206 -0
- package/node_modules/luxon/src/impl/diff.js +95 -0
- package/node_modules/luxon/src/impl/digits.js +94 -0
- package/node_modules/luxon/src/impl/english.js +233 -0
- package/node_modules/luxon/src/impl/formats.js +176 -0
- package/node_modules/luxon/src/impl/formatter.js +434 -0
- package/node_modules/luxon/src/impl/invalid.js +14 -0
- package/node_modules/luxon/src/impl/locale.js +569 -0
- package/node_modules/luxon/src/impl/regexParser.js +335 -0
- package/node_modules/luxon/src/impl/tokenParser.js +505 -0
- package/node_modules/luxon/src/impl/util.js +330 -0
- package/node_modules/luxon/src/impl/zoneUtil.js +34 -0
- package/node_modules/luxon/src/info.js +205 -0
- package/node_modules/luxon/src/interval.js +669 -0
- package/node_modules/luxon/src/luxon.js +26 -0
- package/node_modules/luxon/src/package.json +4 -0
- package/node_modules/luxon/src/settings.js +180 -0
- package/node_modules/luxon/src/zone.js +97 -0
- package/node_modules/luxon/src/zones/IANAZone.js +235 -0
- package/node_modules/luxon/src/zones/fixedOffsetZone.js +150 -0
- package/node_modules/luxon/src/zones/invalidZone.js +53 -0
- package/node_modules/luxon/src/zones/systemZone.js +61 -0
- package/package.json +33 -24
|
@@ -300,7 +300,7 @@ function isKeyOperator(operator) {
|
|
|
300
300
|
function getValues(context, operator, key, modifier) {
|
|
301
301
|
var value = context[key], result = [];
|
|
302
302
|
if (isDefined(value) && value !== "") {
|
|
303
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
303
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
|
|
304
304
|
value = value.toString();
|
|
305
305
|
if (modifier && modifier !== "*") {
|
|
306
306
|
value = value.substring(0, parseInt(modifier, 10));
|
|
@@ -595,6 +595,98 @@ var require_fast_content_type_parse = __commonJS({
|
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
|
|
598
|
+
// node_modules/json-with-bigint/json-with-bigint.js
|
|
599
|
+
var intRegex, noiseValue, originalStringify, originalParse, customFormat, bigIntsStringify, noiseStringify, JSONStringify, isContextSourceSupported, convertMarkedBigIntsReviver, JSONParseV2, MAX_INT, MAX_DIGITS, stringsOrLargeNumbers, noiseValueWithQuotes, JSONParse;
|
|
600
|
+
var init_json_with_bigint = __esm({
|
|
601
|
+
"node_modules/json-with-bigint/json-with-bigint.js"() {
|
|
602
|
+
"use strict";
|
|
603
|
+
intRegex = /^-?\d+$/;
|
|
604
|
+
noiseValue = /^-?\d+n+$/;
|
|
605
|
+
originalStringify = JSON.stringify;
|
|
606
|
+
originalParse = JSON.parse;
|
|
607
|
+
customFormat = /^-?\d+n$/;
|
|
608
|
+
bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
609
|
+
noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
610
|
+
JSONStringify = (value, replacer, space) => {
|
|
611
|
+
if ("rawJSON" in JSON) {
|
|
612
|
+
return originalStringify(
|
|
613
|
+
value,
|
|
614
|
+
(key, value2) => {
|
|
615
|
+
if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString());
|
|
616
|
+
if (typeof replacer === "function") return replacer(key, value2);
|
|
617
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value2;
|
|
618
|
+
return value2;
|
|
619
|
+
},
|
|
620
|
+
space
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
if (!value) return originalStringify(value, replacer, space);
|
|
624
|
+
const convertedToCustomJSON = originalStringify(
|
|
625
|
+
value,
|
|
626
|
+
(key, value2) => {
|
|
627
|
+
const isNoise = typeof value2 === "string" && Boolean(value2.match(noiseValue));
|
|
628
|
+
if (isNoise) return value2.toString() + "n";
|
|
629
|
+
if (typeof value2 === "bigint") return value2.toString() + "n";
|
|
630
|
+
if (typeof replacer === "function") return replacer(key, value2);
|
|
631
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value2;
|
|
632
|
+
return value2;
|
|
633
|
+
},
|
|
634
|
+
space
|
|
635
|
+
);
|
|
636
|
+
const processedJSON = convertedToCustomJSON.replace(
|
|
637
|
+
bigIntsStringify,
|
|
638
|
+
"$1$2$3"
|
|
639
|
+
);
|
|
640
|
+
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
|
|
641
|
+
return denoisedJSON;
|
|
642
|
+
};
|
|
643
|
+
isContextSourceSupported = () => JSON.parse("1", (_, __, context) => !!context && context.source === "1");
|
|
644
|
+
convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
|
|
645
|
+
const isCustomFormatBigInt = typeof value === "string" && value.match(customFormat);
|
|
646
|
+
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
|
|
647
|
+
const isNoiseValue = typeof value === "string" && value.match(noiseValue);
|
|
648
|
+
if (isNoiseValue) return value.slice(0, -1);
|
|
649
|
+
if (typeof userReviver !== "function") return value;
|
|
650
|
+
return userReviver(key, value, context);
|
|
651
|
+
};
|
|
652
|
+
JSONParseV2 = (text, reviver) => {
|
|
653
|
+
return JSON.parse(text, (key, value, context) => {
|
|
654
|
+
const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
|
|
655
|
+
const isInt = context && intRegex.test(context.source);
|
|
656
|
+
const isBigInt = isBigNumber && isInt;
|
|
657
|
+
if (isBigInt) return BigInt(context.source);
|
|
658
|
+
if (typeof reviver !== "function") return value;
|
|
659
|
+
return reviver(key, value, context);
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
663
|
+
MAX_DIGITS = MAX_INT.length;
|
|
664
|
+
stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
665
|
+
noiseValueWithQuotes = /^"-?\d+n+"$/;
|
|
666
|
+
JSONParse = (text, reviver) => {
|
|
667
|
+
if (!text) return originalParse(text, reviver);
|
|
668
|
+
if (isContextSourceSupported()) return JSONParseV2(text, reviver);
|
|
669
|
+
const serializedData = text.replace(
|
|
670
|
+
stringsOrLargeNumbers,
|
|
671
|
+
(text2, digits, fractional, exponential) => {
|
|
672
|
+
const isString = text2[0] === '"';
|
|
673
|
+
const isNoise = isString && Boolean(text2.match(noiseValueWithQuotes));
|
|
674
|
+
if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
|
|
675
|
+
const isFractionalOrExponential = fractional || exponential;
|
|
676
|
+
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
|
|
677
|
+
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
|
|
678
|
+
return text2;
|
|
679
|
+
return '"' + text2 + 'n"';
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
return originalParse(
|
|
683
|
+
serializedData,
|
|
684
|
+
(key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
|
|
685
|
+
);
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
598
690
|
// node_modules/@octokit/request-error/dist-src/index.js
|
|
599
691
|
var RequestError;
|
|
600
692
|
var init_dist_src = __esm({
|
|
@@ -658,7 +750,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
658
750
|
}
|
|
659
751
|
const log = requestOptions.request?.log || console;
|
|
660
752
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
661
|
-
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ?
|
|
753
|
+
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
662
754
|
const requestHeaders = Object.fromEntries(
|
|
663
755
|
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
664
756
|
name,
|
|
@@ -757,7 +849,7 @@ async function getResponseData(response) {
|
|
|
757
849
|
let text = "";
|
|
758
850
|
try {
|
|
759
851
|
text = await response.text();
|
|
760
|
-
return
|
|
852
|
+
return JSONParse(text);
|
|
761
853
|
} catch (err) {
|
|
762
854
|
return text;
|
|
763
855
|
}
|
|
@@ -816,8 +908,9 @@ var init_dist_bundle2 = __esm({
|
|
|
816
908
|
init_dist_bundle();
|
|
817
909
|
init_universal_user_agent();
|
|
818
910
|
import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
|
|
911
|
+
init_json_with_bigint();
|
|
819
912
|
init_dist_src();
|
|
820
|
-
VERSION2 = "10.0.
|
|
913
|
+
VERSION2 = "10.0.8";
|
|
821
914
|
defaults_default = {
|
|
822
915
|
headers: {
|
|
823
916
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
@@ -5040,6 +5133,8 @@ function requiresAppAuth(url) {
|
|
|
5040
5133
|
}
|
|
5041
5134
|
function isNotTimeSkewError(error) {
|
|
5042
5135
|
return !(error.message.match(
|
|
5136
|
+
/'Expiration time' claim \('exp'\) is too far in the future/
|
|
5137
|
+
) || error.message.match(
|
|
5043
5138
|
/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/
|
|
5044
5139
|
) || error.message.match(
|
|
5045
5140
|
/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/
|
|
@@ -5201,11 +5296,12 @@ var init_dist_node = __esm({
|
|
|
5201
5296
|
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
5202
5297
|
"/orgs/{org}/installation",
|
|
5203
5298
|
"/repos/{owner}/{repo}/installation",
|
|
5204
|
-
"/users/{username}/installation"
|
|
5299
|
+
"/users/{username}/installation",
|
|
5300
|
+
"/enterprises/{enterprise}/installation"
|
|
5205
5301
|
];
|
|
5206
5302
|
REGEX = routeMatcher(PATHS);
|
|
5207
5303
|
FIVE_SECONDS_IN_MS = 5 * 1e3;
|
|
5208
|
-
VERSION12 = "8.
|
|
5304
|
+
VERSION12 = "8.2.0";
|
|
5209
5305
|
}
|
|
5210
5306
|
});
|
|
5211
5307
|
|
|
@@ -5231,11 +5327,11 @@ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
|
|
|
5231
5327
|
var sm = new import_client_secrets_manager.SecretsManagerClient();
|
|
5232
5328
|
async function getSecretValue(arn) {
|
|
5233
5329
|
if (!arn) {
|
|
5234
|
-
throw new Error("Missing secret ARN");
|
|
5330
|
+
throw new Error("Missing secret ARN. Check the Lambda configuration and required environment variables.");
|
|
5235
5331
|
}
|
|
5236
5332
|
const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
|
|
5237
5333
|
if (!secret.SecretString) {
|
|
5238
|
-
throw new Error(
|
|
5334
|
+
throw new Error("Secrets Manager getSecretValue returned no SecretString. This often indicates that the secret was stored as binary data (SecretBinary) instead of a string. Ensure the secret is stored in SecretString or update the code to handle SecretBinary.");
|
|
5239
5335
|
}
|
|
5240
5336
|
return secret.SecretString;
|
|
5241
5337
|
}
|
|
@@ -5364,7 +5460,7 @@ async function isDeploymentPending(payload) {
|
|
|
5364
5460
|
} catch (e) {
|
|
5365
5461
|
console.error({
|
|
5366
5462
|
notice: "Unable to check deployment. Try adding deployment read permission.",
|
|
5367
|
-
error:
|
|
5463
|
+
error: e
|
|
5368
5464
|
});
|
|
5369
5465
|
return false;
|
|
5370
5466
|
}
|
|
@@ -5457,7 +5553,7 @@ async function handler2(event) {
|
|
|
5457
5553
|
} catch (e) {
|
|
5458
5554
|
console.error({
|
|
5459
5555
|
notice: "Bad signature",
|
|
5460
|
-
error:
|
|
5556
|
+
error: e
|
|
5461
5557
|
});
|
|
5462
5558
|
return {
|
|
5463
5559
|
statusCode: 403,
|
|
@@ -5533,6 +5629,7 @@ async function handler2(event) {
|
|
|
5533
5629
|
};
|
|
5534
5630
|
}
|
|
5535
5631
|
const executionName = generateExecutionName(event, payload);
|
|
5632
|
+
const idleTimeoutSeconds = process.env.IDLE_TIMEOUT_SECONDS ? parseInt(process.env.IDLE_TIMEOUT_SECONDS, 10) : 300;
|
|
5536
5633
|
const input = {
|
|
5537
5634
|
owner: payload.repository.owner.login,
|
|
5538
5635
|
repo: payload.repository.name,
|
|
@@ -5543,8 +5640,9 @@ async function handler2(event) {
|
|
|
5543
5640
|
jobLabels: payload.workflow_job.labels.join(","),
|
|
5544
5641
|
// original labels requested by the job
|
|
5545
5642
|
provider: selection.provider,
|
|
5546
|
-
labels: selection.labels.join(",")
|
|
5643
|
+
labels: selection.labels.join(","),
|
|
5547
5644
|
// labels to use when registering runner
|
|
5645
|
+
maxIdleSeconds: idleTimeoutSeconds
|
|
5548
5646
|
};
|
|
5549
5647
|
const execution = await sf.send(new import_client_sfn.StartExecutionCommand({
|
|
5550
5648
|
stateMachineArn: process.env.STEP_FUNCTION_ARN,
|
|
@@ -300,7 +300,7 @@ function isKeyOperator(operator) {
|
|
|
300
300
|
function getValues(context, operator, key, modifier) {
|
|
301
301
|
var value = context[key], result = [];
|
|
302
302
|
if (isDefined(value) && value !== "") {
|
|
303
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
303
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
|
|
304
304
|
value = value.toString();
|
|
305
305
|
if (modifier && modifier !== "*") {
|
|
306
306
|
value = value.substring(0, parseInt(modifier, 10));
|
|
@@ -595,6 +595,98 @@ var require_fast_content_type_parse = __commonJS({
|
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
|
|
598
|
+
// node_modules/json-with-bigint/json-with-bigint.js
|
|
599
|
+
var intRegex, noiseValue, originalStringify, originalParse, customFormat, bigIntsStringify, noiseStringify, JSONStringify, isContextSourceSupported, convertMarkedBigIntsReviver, JSONParseV2, MAX_INT, MAX_DIGITS, stringsOrLargeNumbers, noiseValueWithQuotes, JSONParse;
|
|
600
|
+
var init_json_with_bigint = __esm({
|
|
601
|
+
"node_modules/json-with-bigint/json-with-bigint.js"() {
|
|
602
|
+
"use strict";
|
|
603
|
+
intRegex = /^-?\d+$/;
|
|
604
|
+
noiseValue = /^-?\d+n+$/;
|
|
605
|
+
originalStringify = JSON.stringify;
|
|
606
|
+
originalParse = JSON.parse;
|
|
607
|
+
customFormat = /^-?\d+n$/;
|
|
608
|
+
bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
609
|
+
noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
|
|
610
|
+
JSONStringify = (value, replacer, space) => {
|
|
611
|
+
if ("rawJSON" in JSON) {
|
|
612
|
+
return originalStringify(
|
|
613
|
+
value,
|
|
614
|
+
(key, value2) => {
|
|
615
|
+
if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString());
|
|
616
|
+
if (typeof replacer === "function") return replacer(key, value2);
|
|
617
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value2;
|
|
618
|
+
return value2;
|
|
619
|
+
},
|
|
620
|
+
space
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
if (!value) return originalStringify(value, replacer, space);
|
|
624
|
+
const convertedToCustomJSON = originalStringify(
|
|
625
|
+
value,
|
|
626
|
+
(key, value2) => {
|
|
627
|
+
const isNoise = typeof value2 === "string" && Boolean(value2.match(noiseValue));
|
|
628
|
+
if (isNoise) return value2.toString() + "n";
|
|
629
|
+
if (typeof value2 === "bigint") return value2.toString() + "n";
|
|
630
|
+
if (typeof replacer === "function") return replacer(key, value2);
|
|
631
|
+
if (Array.isArray(replacer) && replacer.includes(key)) return value2;
|
|
632
|
+
return value2;
|
|
633
|
+
},
|
|
634
|
+
space
|
|
635
|
+
);
|
|
636
|
+
const processedJSON = convertedToCustomJSON.replace(
|
|
637
|
+
bigIntsStringify,
|
|
638
|
+
"$1$2$3"
|
|
639
|
+
);
|
|
640
|
+
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
|
|
641
|
+
return denoisedJSON;
|
|
642
|
+
};
|
|
643
|
+
isContextSourceSupported = () => JSON.parse("1", (_, __, context) => !!context && context.source === "1");
|
|
644
|
+
convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
|
|
645
|
+
const isCustomFormatBigInt = typeof value === "string" && value.match(customFormat);
|
|
646
|
+
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
|
|
647
|
+
const isNoiseValue = typeof value === "string" && value.match(noiseValue);
|
|
648
|
+
if (isNoiseValue) return value.slice(0, -1);
|
|
649
|
+
if (typeof userReviver !== "function") return value;
|
|
650
|
+
return userReviver(key, value, context);
|
|
651
|
+
};
|
|
652
|
+
JSONParseV2 = (text, reviver) => {
|
|
653
|
+
return JSON.parse(text, (key, value, context) => {
|
|
654
|
+
const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
|
|
655
|
+
const isInt = context && intRegex.test(context.source);
|
|
656
|
+
const isBigInt = isBigNumber && isInt;
|
|
657
|
+
if (isBigInt) return BigInt(context.source);
|
|
658
|
+
if (typeof reviver !== "function") return value;
|
|
659
|
+
return reviver(key, value, context);
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
663
|
+
MAX_DIGITS = MAX_INT.length;
|
|
664
|
+
stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
665
|
+
noiseValueWithQuotes = /^"-?\d+n+"$/;
|
|
666
|
+
JSONParse = (text, reviver) => {
|
|
667
|
+
if (!text) return originalParse(text, reviver);
|
|
668
|
+
if (isContextSourceSupported()) return JSONParseV2(text, reviver);
|
|
669
|
+
const serializedData = text.replace(
|
|
670
|
+
stringsOrLargeNumbers,
|
|
671
|
+
(text2, digits, fractional, exponential) => {
|
|
672
|
+
const isString = text2[0] === '"';
|
|
673
|
+
const isNoise = isString && Boolean(text2.match(noiseValueWithQuotes));
|
|
674
|
+
if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
|
|
675
|
+
const isFractionalOrExponential = fractional || exponential;
|
|
676
|
+
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
|
|
677
|
+
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
|
|
678
|
+
return text2;
|
|
679
|
+
return '"' + text2 + 'n"';
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
return originalParse(
|
|
683
|
+
serializedData,
|
|
684
|
+
(key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
|
|
685
|
+
);
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
598
690
|
// node_modules/@octokit/request-error/dist-src/index.js
|
|
599
691
|
var RequestError;
|
|
600
692
|
var init_dist_src = __esm({
|
|
@@ -658,7 +750,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
658
750
|
}
|
|
659
751
|
const log = requestOptions.request?.log || console;
|
|
660
752
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
661
|
-
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ?
|
|
753
|
+
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
662
754
|
const requestHeaders = Object.fromEntries(
|
|
663
755
|
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
664
756
|
name,
|
|
@@ -757,7 +849,7 @@ async function getResponseData(response) {
|
|
|
757
849
|
let text = "";
|
|
758
850
|
try {
|
|
759
851
|
text = await response.text();
|
|
760
|
-
return
|
|
852
|
+
return JSONParse(text);
|
|
761
853
|
} catch (err) {
|
|
762
854
|
return text;
|
|
763
855
|
}
|
|
@@ -816,8 +908,9 @@ var init_dist_bundle2 = __esm({
|
|
|
816
908
|
init_dist_bundle();
|
|
817
909
|
init_universal_user_agent();
|
|
818
910
|
import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
|
|
911
|
+
init_json_with_bigint();
|
|
819
912
|
init_dist_src();
|
|
820
|
-
VERSION2 = "10.0.
|
|
913
|
+
VERSION2 = "10.0.8";
|
|
821
914
|
defaults_default = {
|
|
822
915
|
headers: {
|
|
823
916
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
@@ -5040,6 +5133,8 @@ function requiresAppAuth(url) {
|
|
|
5040
5133
|
}
|
|
5041
5134
|
function isNotTimeSkewError(error) {
|
|
5042
5135
|
return !(error.message.match(
|
|
5136
|
+
/'Expiration time' claim \('exp'\) is too far in the future/
|
|
5137
|
+
) || error.message.match(
|
|
5043
5138
|
/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/
|
|
5044
5139
|
) || error.message.match(
|
|
5045
5140
|
/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/
|
|
@@ -5201,11 +5296,12 @@ var init_dist_node = __esm({
|
|
|
5201
5296
|
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
5202
5297
|
"/orgs/{org}/installation",
|
|
5203
5298
|
"/repos/{owner}/{repo}/installation",
|
|
5204
|
-
"/users/{username}/installation"
|
|
5299
|
+
"/users/{username}/installation",
|
|
5300
|
+
"/enterprises/{enterprise}/installation"
|
|
5205
5301
|
];
|
|
5206
5302
|
REGEX = routeMatcher(PATHS);
|
|
5207
5303
|
FIVE_SECONDS_IN_MS = 5 * 1e3;
|
|
5208
|
-
VERSION12 = "8.
|
|
5304
|
+
VERSION12 = "8.2.0";
|
|
5209
5305
|
}
|
|
5210
5306
|
});
|
|
5211
5307
|
|
|
@@ -5222,11 +5318,11 @@ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
|
|
|
5222
5318
|
var sm = new import_client_secrets_manager.SecretsManagerClient();
|
|
5223
5319
|
async function getSecretValue(arn) {
|
|
5224
5320
|
if (!arn) {
|
|
5225
|
-
throw new Error("Missing secret ARN");
|
|
5321
|
+
throw new Error("Missing secret ARN. Check the Lambda configuration and required environment variables.");
|
|
5226
5322
|
}
|
|
5227
5323
|
const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
|
|
5228
5324
|
if (!secret.SecretString) {
|
|
5229
|
-
throw new Error(
|
|
5325
|
+
throw new Error("Secrets Manager getSecretValue returned no SecretString. This often indicates that the secret was stored as binary data (SecretBinary) instead of a string. Ensure the secret is stored in SecretString or update the code to handle SecretBinary.");
|
|
5230
5326
|
}
|
|
5231
5327
|
return secret.SecretString;
|
|
5232
5328
|
}
|
|
@@ -5274,6 +5370,7 @@ async function getAppOctokit() {
|
|
|
5274
5370
|
}
|
|
5275
5371
|
async function redeliver(octokit, deliveryId) {
|
|
5276
5372
|
const response = await octokit.rest.apps.redeliverWebhookDelivery({
|
|
5373
|
+
// waiting for new octokit -- https://github.com/octokit/request.js/issues/797#issuecomment-3953274583
|
|
5277
5374
|
delivery_id: deliveryId
|
|
5278
5375
|
});
|
|
5279
5376
|
if (response.status !== 202) {
|
|
@@ -5281,7 +5378,7 @@ async function redeliver(octokit, deliveryId) {
|
|
|
5281
5378
|
}
|
|
5282
5379
|
console.log({
|
|
5283
5380
|
notice: "Successfully redelivered webhook delivery",
|
|
5284
|
-
deliveryId
|
|
5381
|
+
deliveryId: String(deliveryId)
|
|
5285
5382
|
});
|
|
5286
5383
|
}
|
|
5287
5384
|
|
|
@@ -5290,30 +5387,31 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5290
5387
|
const deliveries = /* @__PURE__ */ new Map();
|
|
5291
5388
|
const successfulDeliveries = /* @__PURE__ */ new Set();
|
|
5292
5389
|
const timeLimitMs = 1e3 * 60 * 30;
|
|
5293
|
-
let lastId =
|
|
5390
|
+
let lastId = 0n;
|
|
5294
5391
|
let processedCount = 0;
|
|
5295
5392
|
for await (const response of octokit.paginate.iterator("GET /app/hook/deliveries")) {
|
|
5296
5393
|
if (response.status !== 200) {
|
|
5297
5394
|
throw new Error("Failed to fetch webhook deliveries");
|
|
5298
5395
|
}
|
|
5299
5396
|
for (const delivery of response.data) {
|
|
5397
|
+
const deliveryId = BigInt(delivery.id);
|
|
5300
5398
|
const deliveredAt = new Date(delivery.delivered_at);
|
|
5301
5399
|
const success = delivery.status === "OK";
|
|
5302
|
-
if (
|
|
5400
|
+
if (deliveryId <= sinceId) {
|
|
5303
5401
|
console.info({
|
|
5304
5402
|
notice: "Reached last processed delivery ID",
|
|
5305
|
-
sinceId,
|
|
5306
|
-
deliveryId:
|
|
5403
|
+
sinceId: String(sinceId),
|
|
5404
|
+
deliveryId: String(deliveryId),
|
|
5307
5405
|
guid: delivery.guid,
|
|
5308
5406
|
processedCount
|
|
5309
5407
|
});
|
|
5310
5408
|
return { deliveries, lastId };
|
|
5311
5409
|
}
|
|
5312
|
-
lastId =
|
|
5410
|
+
lastId = deliveryId > lastId ? deliveryId : lastId;
|
|
5313
5411
|
if (deliveredAt.getTime() < Date.now() - timeLimitMs) {
|
|
5314
5412
|
console.info({
|
|
5315
5413
|
notice: "Stopping at old delivery",
|
|
5316
|
-
deliveryId:
|
|
5414
|
+
deliveryId: String(deliveryId),
|
|
5317
5415
|
guid: delivery.guid,
|
|
5318
5416
|
deliveredAt,
|
|
5319
5417
|
processedCount
|
|
@@ -5322,7 +5420,7 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5322
5420
|
}
|
|
5323
5421
|
console.debug({
|
|
5324
5422
|
notice: "Processing webhook delivery",
|
|
5325
|
-
deliveryId:
|
|
5423
|
+
deliveryId: String(deliveryId),
|
|
5326
5424
|
guid: delivery.guid,
|
|
5327
5425
|
status: delivery.status,
|
|
5328
5426
|
deliveredAt: delivery.delivered_at,
|
|
@@ -5336,7 +5434,7 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5336
5434
|
if (successfulDeliveries.has(delivery.guid)) {
|
|
5337
5435
|
continue;
|
|
5338
5436
|
}
|
|
5339
|
-
deliveries.set(delivery.guid, { id:
|
|
5437
|
+
deliveries.set(delivery.guid, { id: deliveryId, deliveredAt, redelivery: delivery.redelivery });
|
|
5340
5438
|
}
|
|
5341
5439
|
}
|
|
5342
5440
|
console.info({
|
|
@@ -5348,10 +5446,10 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5348
5446
|
});
|
|
5349
5447
|
return { deliveries, lastId };
|
|
5350
5448
|
}
|
|
5351
|
-
var lastDeliveryIdProcessed =
|
|
5449
|
+
var lastDeliveryIdProcessed = 0n;
|
|
5352
5450
|
var failures = /* @__PURE__ */ new Map();
|
|
5353
5451
|
function clearFailuresCache() {
|
|
5354
|
-
lastDeliveryIdProcessed =
|
|
5452
|
+
lastDeliveryIdProcessed = 0n;
|
|
5355
5453
|
failures.clear();
|
|
5356
5454
|
}
|
|
5357
5455
|
async function handler2() {
|
|
@@ -5364,14 +5462,14 @@ async function handler2() {
|
|
|
5364
5462
|
return;
|
|
5365
5463
|
}
|
|
5366
5464
|
const { deliveries, lastId } = await newDeliveryFailures(octokit, lastDeliveryIdProcessed);
|
|
5367
|
-
lastDeliveryIdProcessed =
|
|
5465
|
+
lastDeliveryIdProcessed = lastId > lastDeliveryIdProcessed ? lastId : lastDeliveryIdProcessed;
|
|
5368
5466
|
const timeLimitMs = 1e3 * 60 * 60 * 3;
|
|
5369
5467
|
for (const [guid, details] of deliveries) {
|
|
5370
5468
|
if (!details.redelivery) {
|
|
5371
5469
|
failures.set(guid, { id: details.id, firstDeliveredAt: details.deliveredAt });
|
|
5372
5470
|
console.log({
|
|
5373
5471
|
notice: "Redelivering failed delivery",
|
|
5374
|
-
deliveryId: details.id,
|
|
5472
|
+
deliveryId: String(details.id),
|
|
5375
5473
|
guid,
|
|
5376
5474
|
firstDeliveredAt: details.deliveredAt
|
|
5377
5475
|
});
|
|
@@ -5382,7 +5480,7 @@ async function handler2() {
|
|
|
5382
5480
|
if ((/* @__PURE__ */ new Date()).getTime() - originalFailure.firstDeliveredAt.getTime() < timeLimitMs) {
|
|
5383
5481
|
console.log({
|
|
5384
5482
|
notice: "Redelivering failed delivery",
|
|
5385
|
-
deliveryId: details.id,
|
|
5483
|
+
deliveryId: String(details.id),
|
|
5386
5484
|
guid,
|
|
5387
5485
|
firstDeliveredAt: originalFailure.firstDeliveredAt
|
|
5388
5486
|
});
|
|
@@ -5391,7 +5489,7 @@ async function handler2() {
|
|
|
5391
5489
|
failures.delete(guid);
|
|
5392
5490
|
console.log({
|
|
5393
5491
|
notice: "Skipping redelivery of old failed delivery",
|
|
5394
|
-
deliveryId: details.id,
|
|
5492
|
+
deliveryId: String(details.id),
|
|
5395
5493
|
guid,
|
|
5396
5494
|
firstDeliveredAt: originalFailure?.firstDeliveredAt
|
|
5397
5495
|
});
|
|
@@ -5399,7 +5497,7 @@ async function handler2() {
|
|
|
5399
5497
|
} else {
|
|
5400
5498
|
console.log({
|
|
5401
5499
|
notice: "Skipping redelivery of old failed delivery",
|
|
5402
|
-
deliveryId: details.id,
|
|
5500
|
+
deliveryId: String(details.id),
|
|
5403
5501
|
guid
|
|
5404
5502
|
});
|
|
5405
5503
|
}
|
package/lib/access.js
CHANGED
|
@@ -59,7 +59,7 @@ class LambdaAccess {
|
|
|
59
59
|
}
|
|
60
60
|
exports.LambdaAccess = LambdaAccess;
|
|
61
61
|
_a = JSII_RTTI_SYMBOL_1;
|
|
62
|
-
LambdaAccess[_a] = { fqn: "@cloudsnorkel/cdk-github-runners.LambdaAccess", version: "0.
|
|
62
|
+
LambdaAccess[_a] = { fqn: "@cloudsnorkel/cdk-github-runners.LambdaAccess", version: "0.15.0" };
|
|
63
63
|
/**
|
|
64
64
|
* @internal
|
|
65
65
|
*/
|
|
@@ -57,10 +57,10 @@ async function handler(event) {
|
|
|
57
57
|
repo: event.repo,
|
|
58
58
|
runnerId: runner.id,
|
|
59
59
|
runnerName: event.runnerName,
|
|
60
|
-
error:
|
|
60
|
+
error: e,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
throw new ReraisedError(event);
|
|
65
65
|
}
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
66
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsZXRlLWZhaWxlZC1ydW5uZXIubGFtYmRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2RlbGV0ZS1mYWlsZWQtcnVubmVyLmxhbWJkYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQXFCQSwwQkErQ0M7QUFuRUQsbURBQXNFO0FBR3RFLE1BQU0sVUFBVyxTQUFRLEtBQUs7SUFDNUIsWUFBWSxHQUFXO1FBQ3JCLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNYLElBQUksQ0FBQyxJQUFJLEdBQUcsWUFBWSxDQUFDO1FBQ3pCLE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUNwRCxDQUFDO0NBQ0Y7QUFFRCxNQUFNLGFBQWMsU0FBUSxLQUFLO0lBQy9CLFlBQVksS0FBOEI7UUFDeEMsS0FBSyxDQUFDLEtBQUssQ0FBQyxLQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDMUIsSUFBSSxDQUFDLElBQUksR0FBRyxLQUFLLENBQUMsS0FBTSxDQUFDLEtBQUssQ0FBQztRQUMvQixJQUFJLENBQUMsT0FBTyxHQUFHLEtBQUssQ0FBQyxLQUFNLENBQUMsS0FBSyxDQUFDO1FBQ2xDLE1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