@cloudsnorkel/cdk-github-runners 0.14.24 → 0.15.1
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 +5953 -602
- package/API.md +1349 -115
- package/README.md +53 -1
- package/assets/delete-failed-runner.lambda/index.js +122 -9
- package/assets/idle-runner-repear.lambda/index.js +153 -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 +118 -8
- package/assets/status.lambda/index.js +121 -8
- package/assets/token-retriever.lambda/index.js +121 -8
- package/assets/warm-runner-manager.lambda/index.js +5909 -0
- package/assets/webhook-handler.lambda/index.js +126 -11
- package/assets/webhook-redelivery.lambda/index.js +139 -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 +18 -2
- package/lib/providers/codebuild.js +15 -4
- package/lib/providers/common.d.ts +47 -3
- package/lib/providers/common.js +29 -5
- package/lib/providers/composite.js +14 -19
- package/lib/providers/ec2.d.ts +9 -2
- package/lib/providers/ec2.js +84 -42
- package/lib/providers/ecs.d.ts +19 -2
- package/lib/providers/ecs.js +49 -44
- package/lib/providers/fargate.d.ts +2 -2
- package/lib/providers/fargate.js +19 -36
- package/lib/providers/lambda.d.ts +2 -2
- package/lib/providers/lambda.js +3 -3
- package/lib/runner.d.ts +31 -3
- package/lib/runner.js +171 -46
- 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 +155 -0
- package/lib/warm-runner.js +217 -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,115 @@ 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, featureCache, 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" && noiseValue.test(value2);
|
|
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
|
+
featureCache = /* @__PURE__ */ new Map();
|
|
644
|
+
isContextSourceSupported = () => {
|
|
645
|
+
const parseFingerprint = JSON.parse.toString();
|
|
646
|
+
if (featureCache.has(parseFingerprint)) {
|
|
647
|
+
return featureCache.get(parseFingerprint);
|
|
648
|
+
}
|
|
649
|
+
try {
|
|
650
|
+
const result = JSON.parse(
|
|
651
|
+
"1",
|
|
652
|
+
(_, __, context) => !!context?.source && context.source === "1"
|
|
653
|
+
);
|
|
654
|
+
featureCache.set(parseFingerprint, result);
|
|
655
|
+
return result;
|
|
656
|
+
} catch {
|
|
657
|
+
featureCache.set(parseFingerprint, false);
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
|
|
662
|
+
const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value);
|
|
663
|
+
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
|
|
664
|
+
const isNoiseValue = typeof value === "string" && noiseValue.test(value);
|
|
665
|
+
if (isNoiseValue) return value.slice(0, -1);
|
|
666
|
+
if (typeof userReviver !== "function") return value;
|
|
667
|
+
return userReviver(key, value, context);
|
|
668
|
+
};
|
|
669
|
+
JSONParseV2 = (text, reviver) => {
|
|
670
|
+
return JSON.parse(text, (key, value, context) => {
|
|
671
|
+
const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
|
|
672
|
+
const isInt = context && intRegex.test(context.source);
|
|
673
|
+
const isBigInt = isBigNumber && isInt;
|
|
674
|
+
if (isBigInt) return BigInt(context.source);
|
|
675
|
+
if (typeof reviver !== "function") return value;
|
|
676
|
+
return reviver(key, value, context);
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
680
|
+
MAX_DIGITS = MAX_INT.length;
|
|
681
|
+
stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
682
|
+
noiseValueWithQuotes = /^"-?\d+n+"$/;
|
|
683
|
+
JSONParse = (text, reviver) => {
|
|
684
|
+
if (!text) return originalParse(text, reviver);
|
|
685
|
+
if (isContextSourceSupported()) return JSONParseV2(text, reviver);
|
|
686
|
+
const serializedData = text.replace(
|
|
687
|
+
stringsOrLargeNumbers,
|
|
688
|
+
(text2, digits, fractional, exponential) => {
|
|
689
|
+
const isString = text2[0] === '"';
|
|
690
|
+
const isNoise = isString && noiseValueWithQuotes.test(text2);
|
|
691
|
+
if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
|
|
692
|
+
const isFractionalOrExponential = fractional || exponential;
|
|
693
|
+
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
|
|
694
|
+
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
|
|
695
|
+
return text2;
|
|
696
|
+
return '"' + text2 + 'n"';
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
return originalParse(
|
|
700
|
+
serializedData,
|
|
701
|
+
(key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
|
|
702
|
+
);
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
|
|
598
707
|
// node_modules/@octokit/request-error/dist-src/index.js
|
|
599
708
|
var RequestError;
|
|
600
709
|
var init_dist_src = __esm({
|
|
@@ -658,7 +767,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
658
767
|
}
|
|
659
768
|
const log = requestOptions.request?.log || console;
|
|
660
769
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
661
|
-
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ?
|
|
770
|
+
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
662
771
|
const requestHeaders = Object.fromEntries(
|
|
663
772
|
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
664
773
|
name,
|
|
@@ -757,7 +866,7 @@ async function getResponseData(response) {
|
|
|
757
866
|
let text = "";
|
|
758
867
|
try {
|
|
759
868
|
text = await response.text();
|
|
760
|
-
return
|
|
869
|
+
return JSONParse(text);
|
|
761
870
|
} catch (err) {
|
|
762
871
|
return text;
|
|
763
872
|
}
|
|
@@ -816,8 +925,9 @@ var init_dist_bundle2 = __esm({
|
|
|
816
925
|
init_dist_bundle();
|
|
817
926
|
init_universal_user_agent();
|
|
818
927
|
import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
|
|
928
|
+
init_json_with_bigint();
|
|
819
929
|
init_dist_src();
|
|
820
|
-
VERSION2 = "10.0.
|
|
930
|
+
VERSION2 = "10.0.8";
|
|
821
931
|
defaults_default = {
|
|
822
932
|
headers: {
|
|
823
933
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
@@ -5040,6 +5150,8 @@ function requiresAppAuth(url) {
|
|
|
5040
5150
|
}
|
|
5041
5151
|
function isNotTimeSkewError(error) {
|
|
5042
5152
|
return !(error.message.match(
|
|
5153
|
+
/'Expiration time' claim \('exp'\) is too far in the future/
|
|
5154
|
+
) || error.message.match(
|
|
5043
5155
|
/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/
|
|
5044
5156
|
) || error.message.match(
|
|
5045
5157
|
/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/
|
|
@@ -5201,11 +5313,12 @@ var init_dist_node = __esm({
|
|
|
5201
5313
|
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
5202
5314
|
"/orgs/{org}/installation",
|
|
5203
5315
|
"/repos/{owner}/{repo}/installation",
|
|
5204
|
-
"/users/{username}/installation"
|
|
5316
|
+
"/users/{username}/installation",
|
|
5317
|
+
"/enterprises/{enterprise}/installation"
|
|
5205
5318
|
];
|
|
5206
5319
|
REGEX = routeMatcher(PATHS);
|
|
5207
5320
|
FIVE_SECONDS_IN_MS = 5 * 1e3;
|
|
5208
|
-
VERSION12 = "8.
|
|
5321
|
+
VERSION12 = "8.2.0";
|
|
5209
5322
|
}
|
|
5210
5323
|
});
|
|
5211
5324
|
|
|
@@ -5231,11 +5344,11 @@ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
|
|
|
5231
5344
|
var sm = new import_client_secrets_manager.SecretsManagerClient();
|
|
5232
5345
|
async function getSecretValue(arn) {
|
|
5233
5346
|
if (!arn) {
|
|
5234
|
-
throw new Error("Missing secret ARN");
|
|
5347
|
+
throw new Error("Missing secret ARN. Check the Lambda configuration and required environment variables.");
|
|
5235
5348
|
}
|
|
5236
5349
|
const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
|
|
5237
5350
|
if (!secret.SecretString) {
|
|
5238
|
-
throw new Error(
|
|
5351
|
+
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
5352
|
}
|
|
5240
5353
|
return secret.SecretString;
|
|
5241
5354
|
}
|
|
@@ -5364,7 +5477,7 @@ async function isDeploymentPending(payload) {
|
|
|
5364
5477
|
} catch (e) {
|
|
5365
5478
|
console.error({
|
|
5366
5479
|
notice: "Unable to check deployment. Try adding deployment read permission.",
|
|
5367
|
-
error:
|
|
5480
|
+
error: e
|
|
5368
5481
|
});
|
|
5369
5482
|
return false;
|
|
5370
5483
|
}
|
|
@@ -5457,7 +5570,7 @@ async function handler2(event) {
|
|
|
5457
5570
|
} catch (e) {
|
|
5458
5571
|
console.error({
|
|
5459
5572
|
notice: "Bad signature",
|
|
5460
|
-
error:
|
|
5573
|
+
error: e
|
|
5461
5574
|
});
|
|
5462
5575
|
return {
|
|
5463
5576
|
statusCode: 403,
|
|
@@ -5533,6 +5646,7 @@ async function handler2(event) {
|
|
|
5533
5646
|
};
|
|
5534
5647
|
}
|
|
5535
5648
|
const executionName = generateExecutionName(event, payload);
|
|
5649
|
+
const idleTimeoutSeconds = process.env.IDLE_TIMEOUT_SECONDS ? parseInt(process.env.IDLE_TIMEOUT_SECONDS, 10) : 300;
|
|
5536
5650
|
const input = {
|
|
5537
5651
|
owner: payload.repository.owner.login,
|
|
5538
5652
|
repo: payload.repository.name,
|
|
@@ -5543,8 +5657,9 @@ async function handler2(event) {
|
|
|
5543
5657
|
jobLabels: payload.workflow_job.labels.join(","),
|
|
5544
5658
|
// original labels requested by the job
|
|
5545
5659
|
provider: selection.provider,
|
|
5546
|
-
labels: selection.labels.join(",")
|
|
5660
|
+
labels: selection.labels.join(","),
|
|
5547
5661
|
// labels to use when registering runner
|
|
5662
|
+
maxIdleSeconds: idleTimeoutSeconds
|
|
5548
5663
|
};
|
|
5549
5664
|
const execution = await sf.send(new import_client_sfn.StartExecutionCommand({
|
|
5550
5665
|
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,115 @@ 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, featureCache, 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" && noiseValue.test(value2);
|
|
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
|
+
featureCache = /* @__PURE__ */ new Map();
|
|
644
|
+
isContextSourceSupported = () => {
|
|
645
|
+
const parseFingerprint = JSON.parse.toString();
|
|
646
|
+
if (featureCache.has(parseFingerprint)) {
|
|
647
|
+
return featureCache.get(parseFingerprint);
|
|
648
|
+
}
|
|
649
|
+
try {
|
|
650
|
+
const result = JSON.parse(
|
|
651
|
+
"1",
|
|
652
|
+
(_, __, context) => !!context?.source && context.source === "1"
|
|
653
|
+
);
|
|
654
|
+
featureCache.set(parseFingerprint, result);
|
|
655
|
+
return result;
|
|
656
|
+
} catch {
|
|
657
|
+
featureCache.set(parseFingerprint, false);
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
|
|
662
|
+
const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value);
|
|
663
|
+
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
|
|
664
|
+
const isNoiseValue = typeof value === "string" && noiseValue.test(value);
|
|
665
|
+
if (isNoiseValue) return value.slice(0, -1);
|
|
666
|
+
if (typeof userReviver !== "function") return value;
|
|
667
|
+
return userReviver(key, value, context);
|
|
668
|
+
};
|
|
669
|
+
JSONParseV2 = (text, reviver) => {
|
|
670
|
+
return JSON.parse(text, (key, value, context) => {
|
|
671
|
+
const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
|
|
672
|
+
const isInt = context && intRegex.test(context.source);
|
|
673
|
+
const isBigInt = isBigNumber && isInt;
|
|
674
|
+
if (isBigInt) return BigInt(context.source);
|
|
675
|
+
if (typeof reviver !== "function") return value;
|
|
676
|
+
return reviver(key, value, context);
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
MAX_INT = Number.MAX_SAFE_INTEGER.toString();
|
|
680
|
+
MAX_DIGITS = MAX_INT.length;
|
|
681
|
+
stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
|
|
682
|
+
noiseValueWithQuotes = /^"-?\d+n+"$/;
|
|
683
|
+
JSONParse = (text, reviver) => {
|
|
684
|
+
if (!text) return originalParse(text, reviver);
|
|
685
|
+
if (isContextSourceSupported()) return JSONParseV2(text, reviver);
|
|
686
|
+
const serializedData = text.replace(
|
|
687
|
+
stringsOrLargeNumbers,
|
|
688
|
+
(text2, digits, fractional, exponential) => {
|
|
689
|
+
const isString = text2[0] === '"';
|
|
690
|
+
const isNoise = isString && noiseValueWithQuotes.test(text2);
|
|
691
|
+
if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
|
|
692
|
+
const isFractionalOrExponential = fractional || exponential;
|
|
693
|
+
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
|
|
694
|
+
if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
|
|
695
|
+
return text2;
|
|
696
|
+
return '"' + text2 + 'n"';
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
return originalParse(
|
|
700
|
+
serializedData,
|
|
701
|
+
(key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
|
|
702
|
+
);
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
|
|
598
707
|
// node_modules/@octokit/request-error/dist-src/index.js
|
|
599
708
|
var RequestError;
|
|
600
709
|
var init_dist_src = __esm({
|
|
@@ -658,7 +767,7 @@ async function fetchWrapper(requestOptions) {
|
|
|
658
767
|
}
|
|
659
768
|
const log = requestOptions.request?.log || console;
|
|
660
769
|
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
|
|
661
|
-
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ?
|
|
770
|
+
const body = isPlainObject2(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
|
|
662
771
|
const requestHeaders = Object.fromEntries(
|
|
663
772
|
Object.entries(requestOptions.headers).map(([name, value]) => [
|
|
664
773
|
name,
|
|
@@ -757,7 +866,7 @@ async function getResponseData(response) {
|
|
|
757
866
|
let text = "";
|
|
758
867
|
try {
|
|
759
868
|
text = await response.text();
|
|
760
|
-
return
|
|
869
|
+
return JSONParse(text);
|
|
761
870
|
} catch (err) {
|
|
762
871
|
return text;
|
|
763
872
|
}
|
|
@@ -816,8 +925,9 @@ var init_dist_bundle2 = __esm({
|
|
|
816
925
|
init_dist_bundle();
|
|
817
926
|
init_universal_user_agent();
|
|
818
927
|
import_fast_content_type_parse = __toESM(require_fast_content_type_parse(), 1);
|
|
928
|
+
init_json_with_bigint();
|
|
819
929
|
init_dist_src();
|
|
820
|
-
VERSION2 = "10.0.
|
|
930
|
+
VERSION2 = "10.0.8";
|
|
821
931
|
defaults_default = {
|
|
822
932
|
headers: {
|
|
823
933
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
@@ -5040,6 +5150,8 @@ function requiresAppAuth(url) {
|
|
|
5040
5150
|
}
|
|
5041
5151
|
function isNotTimeSkewError(error) {
|
|
5042
5152
|
return !(error.message.match(
|
|
5153
|
+
/'Expiration time' claim \('exp'\) is too far in the future/
|
|
5154
|
+
) || error.message.match(
|
|
5043
5155
|
/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/
|
|
5044
5156
|
) || error.message.match(
|
|
5045
5157
|
/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/
|
|
@@ -5201,11 +5313,12 @@ var init_dist_node = __esm({
|
|
|
5201
5313
|
"/marketplace_listing/stubbed/plans/{plan_id}/accounts",
|
|
5202
5314
|
"/orgs/{org}/installation",
|
|
5203
5315
|
"/repos/{owner}/{repo}/installation",
|
|
5204
|
-
"/users/{username}/installation"
|
|
5316
|
+
"/users/{username}/installation",
|
|
5317
|
+
"/enterprises/{enterprise}/installation"
|
|
5205
5318
|
];
|
|
5206
5319
|
REGEX = routeMatcher(PATHS);
|
|
5207
5320
|
FIVE_SECONDS_IN_MS = 5 * 1e3;
|
|
5208
|
-
VERSION12 = "8.
|
|
5321
|
+
VERSION12 = "8.2.0";
|
|
5209
5322
|
}
|
|
5210
5323
|
});
|
|
5211
5324
|
|
|
@@ -5222,11 +5335,11 @@ var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
|
|
|
5222
5335
|
var sm = new import_client_secrets_manager.SecretsManagerClient();
|
|
5223
5336
|
async function getSecretValue(arn) {
|
|
5224
5337
|
if (!arn) {
|
|
5225
|
-
throw new Error("Missing secret ARN");
|
|
5338
|
+
throw new Error("Missing secret ARN. Check the Lambda configuration and required environment variables.");
|
|
5226
5339
|
}
|
|
5227
5340
|
const secret = await sm.send(new import_client_secrets_manager.GetSecretValueCommand({ SecretId: arn }));
|
|
5228
5341
|
if (!secret.SecretString) {
|
|
5229
|
-
throw new Error(
|
|
5342
|
+
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
5343
|
}
|
|
5231
5344
|
return secret.SecretString;
|
|
5232
5345
|
}
|
|
@@ -5274,6 +5387,7 @@ async function getAppOctokit() {
|
|
|
5274
5387
|
}
|
|
5275
5388
|
async function redeliver(octokit, deliveryId) {
|
|
5276
5389
|
const response = await octokit.rest.apps.redeliverWebhookDelivery({
|
|
5390
|
+
// waiting for new octokit -- https://github.com/octokit/request.js/issues/797#issuecomment-3953274583
|
|
5277
5391
|
delivery_id: deliveryId
|
|
5278
5392
|
});
|
|
5279
5393
|
if (response.status !== 202) {
|
|
@@ -5281,7 +5395,7 @@ async function redeliver(octokit, deliveryId) {
|
|
|
5281
5395
|
}
|
|
5282
5396
|
console.log({
|
|
5283
5397
|
notice: "Successfully redelivered webhook delivery",
|
|
5284
|
-
deliveryId
|
|
5398
|
+
deliveryId: String(deliveryId)
|
|
5285
5399
|
});
|
|
5286
5400
|
}
|
|
5287
5401
|
|
|
@@ -5290,30 +5404,31 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5290
5404
|
const deliveries = /* @__PURE__ */ new Map();
|
|
5291
5405
|
const successfulDeliveries = /* @__PURE__ */ new Set();
|
|
5292
5406
|
const timeLimitMs = 1e3 * 60 * 30;
|
|
5293
|
-
let lastId =
|
|
5407
|
+
let lastId = 0n;
|
|
5294
5408
|
let processedCount = 0;
|
|
5295
5409
|
for await (const response of octokit.paginate.iterator("GET /app/hook/deliveries")) {
|
|
5296
5410
|
if (response.status !== 200) {
|
|
5297
5411
|
throw new Error("Failed to fetch webhook deliveries");
|
|
5298
5412
|
}
|
|
5299
5413
|
for (const delivery of response.data) {
|
|
5414
|
+
const deliveryId = BigInt(delivery.id);
|
|
5300
5415
|
const deliveredAt = new Date(delivery.delivered_at);
|
|
5301
5416
|
const success = delivery.status === "OK";
|
|
5302
|
-
if (
|
|
5417
|
+
if (deliveryId <= sinceId) {
|
|
5303
5418
|
console.info({
|
|
5304
5419
|
notice: "Reached last processed delivery ID",
|
|
5305
|
-
sinceId,
|
|
5306
|
-
deliveryId:
|
|
5420
|
+
sinceId: String(sinceId),
|
|
5421
|
+
deliveryId: String(deliveryId),
|
|
5307
5422
|
guid: delivery.guid,
|
|
5308
5423
|
processedCount
|
|
5309
5424
|
});
|
|
5310
5425
|
return { deliveries, lastId };
|
|
5311
5426
|
}
|
|
5312
|
-
lastId =
|
|
5427
|
+
lastId = deliveryId > lastId ? deliveryId : lastId;
|
|
5313
5428
|
if (deliveredAt.getTime() < Date.now() - timeLimitMs) {
|
|
5314
5429
|
console.info({
|
|
5315
5430
|
notice: "Stopping at old delivery",
|
|
5316
|
-
deliveryId:
|
|
5431
|
+
deliveryId: String(deliveryId),
|
|
5317
5432
|
guid: delivery.guid,
|
|
5318
5433
|
deliveredAt,
|
|
5319
5434
|
processedCount
|
|
@@ -5322,7 +5437,7 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5322
5437
|
}
|
|
5323
5438
|
console.debug({
|
|
5324
5439
|
notice: "Processing webhook delivery",
|
|
5325
|
-
deliveryId:
|
|
5440
|
+
deliveryId: String(deliveryId),
|
|
5326
5441
|
guid: delivery.guid,
|
|
5327
5442
|
status: delivery.status,
|
|
5328
5443
|
deliveredAt: delivery.delivered_at,
|
|
@@ -5336,7 +5451,7 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5336
5451
|
if (successfulDeliveries.has(delivery.guid)) {
|
|
5337
5452
|
continue;
|
|
5338
5453
|
}
|
|
5339
|
-
deliveries.set(delivery.guid, { id:
|
|
5454
|
+
deliveries.set(delivery.guid, { id: deliveryId, deliveredAt, redelivery: delivery.redelivery });
|
|
5340
5455
|
}
|
|
5341
5456
|
}
|
|
5342
5457
|
console.info({
|
|
@@ -5348,10 +5463,10 @@ async function newDeliveryFailures(octokit, sinceId) {
|
|
|
5348
5463
|
});
|
|
5349
5464
|
return { deliveries, lastId };
|
|
5350
5465
|
}
|
|
5351
|
-
var lastDeliveryIdProcessed =
|
|
5466
|
+
var lastDeliveryIdProcessed = 0n;
|
|
5352
5467
|
var failures = /* @__PURE__ */ new Map();
|
|
5353
5468
|
function clearFailuresCache() {
|
|
5354
|
-
lastDeliveryIdProcessed =
|
|
5469
|
+
lastDeliveryIdProcessed = 0n;
|
|
5355
5470
|
failures.clear();
|
|
5356
5471
|
}
|
|
5357
5472
|
async function handler2() {
|
|
@@ -5364,14 +5479,14 @@ async function handler2() {
|
|
|
5364
5479
|
return;
|
|
5365
5480
|
}
|
|
5366
5481
|
const { deliveries, lastId } = await newDeliveryFailures(octokit, lastDeliveryIdProcessed);
|
|
5367
|
-
lastDeliveryIdProcessed =
|
|
5482
|
+
lastDeliveryIdProcessed = lastId > lastDeliveryIdProcessed ? lastId : lastDeliveryIdProcessed;
|
|
5368
5483
|
const timeLimitMs = 1e3 * 60 * 60 * 3;
|
|
5369
5484
|
for (const [guid, details] of deliveries) {
|
|
5370
5485
|
if (!details.redelivery) {
|
|
5371
5486
|
failures.set(guid, { id: details.id, firstDeliveredAt: details.deliveredAt });
|
|
5372
5487
|
console.log({
|
|
5373
5488
|
notice: "Redelivering failed delivery",
|
|
5374
|
-
deliveryId: details.id,
|
|
5489
|
+
deliveryId: String(details.id),
|
|
5375
5490
|
guid,
|
|
5376
5491
|
firstDeliveredAt: details.deliveredAt
|
|
5377
5492
|
});
|
|
@@ -5382,7 +5497,7 @@ async function handler2() {
|
|
|
5382
5497
|
if ((/* @__PURE__ */ new Date()).getTime() - originalFailure.firstDeliveredAt.getTime() < timeLimitMs) {
|
|
5383
5498
|
console.log({
|
|
5384
5499
|
notice: "Redelivering failed delivery",
|
|
5385
|
-
deliveryId: details.id,
|
|
5500
|
+
deliveryId: String(details.id),
|
|
5386
5501
|
guid,
|
|
5387
5502
|
firstDeliveredAt: originalFailure.firstDeliveredAt
|
|
5388
5503
|
});
|
|
@@ -5391,7 +5506,7 @@ async function handler2() {
|
|
|
5391
5506
|
failures.delete(guid);
|
|
5392
5507
|
console.log({
|
|
5393
5508
|
notice: "Skipping redelivery of old failed delivery",
|
|
5394
|
-
deliveryId: details.id,
|
|
5509
|
+
deliveryId: String(details.id),
|
|
5395
5510
|
guid,
|
|
5396
5511
|
firstDeliveredAt: originalFailure?.firstDeliveredAt
|
|
5397
5512
|
});
|
|
@@ -5399,7 +5514,7 @@ async function handler2() {
|
|
|
5399
5514
|
} else {
|
|
5400
5515
|
console.log({
|
|
5401
5516
|
notice: "Skipping redelivery of old failed delivery",
|
|
5402
|
-
deliveryId: details.id,
|
|
5517
|
+
deliveryId: String(details.id),
|
|
5403
5518
|
guid
|
|
5404
5519
|
});
|
|
5405
5520
|
}
|
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.1" };
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsZXRlLWZhaWxlZC1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