@cloudsnorkel/cdk-github-runners 0.3.2 → 0.4.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/.gitattributes +1 -0
- package/.jsii +1418 -418
- package/API.md +1074 -101
- package/README.md +12 -10
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/lambdas/aws-image-builder-versioner/index.js +2469 -0
- package/lib/lambdas/build-image/index.js +77 -43
- package/lib/lambdas/delete-runner/index.js +70 -42
- package/lib/lambdas/setup/index.html +9 -9
- package/lib/lambdas/setup/index.js +27 -12
- package/lib/lambdas/status/index.js +103 -45
- package/lib/lambdas/token-retriever/index.js +70 -42
- package/lib/lambdas/update-lambda/index.js +5 -2
- package/lib/lambdas/webhook-handler/index.js +11 -5
- package/lib/providers/codebuild.d.ts +5 -1
- package/lib/providers/codebuild.js +16 -6
- package/lib/providers/common.d.ts +28 -1
- package/lib/providers/common.js +4 -4
- package/lib/providers/fargate.d.ts +5 -1
- package/lib/providers/fargate.js +3 -3
- package/lib/providers/image-builders/codebuild.d.ts +2 -2
- package/lib/providers/image-builders/codebuild.js +5 -4
- package/lib/providers/image-builders/container.d.ts +220 -0
- package/lib/providers/image-builders/container.js +508 -0
- package/lib/providers/image-builders/static.js +2 -3
- package/lib/providers/lambda.d.ts +5 -1
- package/lib/providers/lambda.js +19 -8
- package/lib/runner.js +29 -13
- package/lib/secrets.js +1 -1
- package/package.json +14 -12
|
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
20
23
|
|
|
21
24
|
// node_modules/universal-user-agent/dist-node/index.js
|
|
22
25
|
var require_dist_node = __commonJS({
|
|
@@ -5951,11 +5954,14 @@ var require_lib3 = __commonJS({
|
|
|
5951
5954
|
blob() {
|
|
5952
5955
|
let ct = this.headers && this.headers.get("content-type") || "";
|
|
5953
5956
|
return consumeBody.call(this).then(function(buf) {
|
|
5954
|
-
return Object.assign(
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5957
|
+
return Object.assign(
|
|
5958
|
+
new Blob([], {
|
|
5959
|
+
type: ct.toLowerCase()
|
|
5960
|
+
}),
|
|
5961
|
+
{
|
|
5962
|
+
[BUFFER]: buf
|
|
5963
|
+
}
|
|
5964
|
+
);
|
|
5959
5965
|
});
|
|
5960
5966
|
},
|
|
5961
5967
|
json() {
|
|
@@ -7012,12 +7018,15 @@ var require_dist_node5 = __commonJS({
|
|
|
7012
7018
|
let status;
|
|
7013
7019
|
let url;
|
|
7014
7020
|
const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
|
|
7015
|
-
return fetch(requestOptions.url, Object.assign(
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
+
return fetch(requestOptions.url, Object.assign(
|
|
7022
|
+
{
|
|
7023
|
+
method: requestOptions.method,
|
|
7024
|
+
body: requestOptions.body,
|
|
7025
|
+
headers: requestOptions.headers,
|
|
7026
|
+
redirect: requestOptions.redirect
|
|
7027
|
+
},
|
|
7028
|
+
requestOptions.request
|
|
7029
|
+
)).then(async (response) => {
|
|
7021
7030
|
url = response.url;
|
|
7022
7031
|
status = response.status;
|
|
7023
7032
|
for (const keyAndValue of response.headers) {
|
|
@@ -7425,7 +7434,7 @@ var require_dist_node6 = __commonJS({
|
|
|
7425
7434
|
parse
|
|
7426
7435
|
});
|
|
7427
7436
|
}
|
|
7428
|
-
var VERSION = "7.0.
|
|
7437
|
+
var VERSION = "7.0.1";
|
|
7429
7438
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
7430
7439
|
var DEFAULTS = {
|
|
7431
7440
|
method: "GET",
|
|
@@ -7511,7 +7520,7 @@ var require_dist_node8 = __commonJS({
|
|
|
7511
7520
|
var isPlainObject = require_is_plain_object();
|
|
7512
7521
|
var nodeFetch = _interopDefault(require_lib3());
|
|
7513
7522
|
var requestError = require_dist_node7();
|
|
7514
|
-
var VERSION = "6.2.
|
|
7523
|
+
var VERSION = "6.2.1";
|
|
7515
7524
|
function getBufferResponse(response) {
|
|
7516
7525
|
return response.arrayBuffer();
|
|
7517
7526
|
}
|
|
@@ -7524,12 +7533,15 @@ var require_dist_node8 = __commonJS({
|
|
|
7524
7533
|
let status;
|
|
7525
7534
|
let url;
|
|
7526
7535
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
7527
|
-
return fetch(requestOptions.url, Object.assign(
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7536
|
+
return fetch(requestOptions.url, Object.assign(
|
|
7537
|
+
{
|
|
7538
|
+
method: requestOptions.method,
|
|
7539
|
+
body: requestOptions.body,
|
|
7540
|
+
headers: requestOptions.headers,
|
|
7541
|
+
redirect: requestOptions.redirect
|
|
7542
|
+
},
|
|
7543
|
+
requestOptions.request
|
|
7544
|
+
)).then(async (response) => {
|
|
7533
7545
|
url = response.url;
|
|
7534
7546
|
status = response.status;
|
|
7535
7547
|
for (const keyAndValue of response.headers) {
|
|
@@ -7980,7 +7992,7 @@ var require_dist_node10 = __commonJS({
|
|
|
7980
7992
|
parse
|
|
7981
7993
|
});
|
|
7982
7994
|
}
|
|
7983
|
-
var VERSION = "7.0.
|
|
7995
|
+
var VERSION = "7.0.1";
|
|
7984
7996
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
7985
7997
|
var DEFAULTS = {
|
|
7986
7998
|
method: "GET",
|
|
@@ -8066,7 +8078,7 @@ var require_dist_node12 = __commonJS({
|
|
|
8066
8078
|
var isPlainObject = require_is_plain_object();
|
|
8067
8079
|
var nodeFetch = _interopDefault(require_lib3());
|
|
8068
8080
|
var requestError = require_dist_node11();
|
|
8069
|
-
var VERSION = "6.2.
|
|
8081
|
+
var VERSION = "6.2.1";
|
|
8070
8082
|
function getBufferResponse(response) {
|
|
8071
8083
|
return response.arrayBuffer();
|
|
8072
8084
|
}
|
|
@@ -8079,12 +8091,15 @@ var require_dist_node12 = __commonJS({
|
|
|
8079
8091
|
let status;
|
|
8080
8092
|
let url;
|
|
8081
8093
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
8082
|
-
return fetch(requestOptions.url, Object.assign(
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8094
|
+
return fetch(requestOptions.url, Object.assign(
|
|
8095
|
+
{
|
|
8096
|
+
method: requestOptions.method,
|
|
8097
|
+
body: requestOptions.body,
|
|
8098
|
+
headers: requestOptions.headers,
|
|
8099
|
+
redirect: requestOptions.redirect
|
|
8100
|
+
},
|
|
8101
|
+
requestOptions.request
|
|
8102
|
+
)).then(async (response) => {
|
|
8088
8103
|
url = response.url;
|
|
8089
8104
|
status = response.status;
|
|
8090
8105
|
for (const keyAndValue of response.headers) {
|
|
@@ -8565,7 +8580,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8565
8580
|
endpoint.headers.authorization = `token ${token}`;
|
|
8566
8581
|
return request2(endpoint);
|
|
8567
8582
|
}
|
|
8568
|
-
var VERSION = "4.0.
|
|
8583
|
+
var VERSION = "4.0.1";
|
|
8569
8584
|
function createOAuthDeviceAuth(options) {
|
|
8570
8585
|
const requestWithDefaults = options.request || request.request.defaults({
|
|
8571
8586
|
headers: {
|
|
@@ -8613,7 +8628,7 @@ var require_dist_node15 = __commonJS({
|
|
|
8613
8628
|
var authOauthDevice = require_dist_node14();
|
|
8614
8629
|
var oauthMethods = require_dist_node13();
|
|
8615
8630
|
var btoa = _interopDefault(require_btoa_node());
|
|
8616
|
-
var VERSION = "2.0.
|
|
8631
|
+
var VERSION = "2.0.3";
|
|
8617
8632
|
async function getAuthentication(state) {
|
|
8618
8633
|
if ("code" in state.strategyOptions) {
|
|
8619
8634
|
const {
|
|
@@ -9792,14 +9807,18 @@ var require_ms = __commonJS({
|
|
|
9792
9807
|
} else if (type === "number" && isFinite(val)) {
|
|
9793
9808
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
9794
9809
|
}
|
|
9795
|
-
throw new Error(
|
|
9810
|
+
throw new Error(
|
|
9811
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
9812
|
+
);
|
|
9796
9813
|
};
|
|
9797
9814
|
function parse(str) {
|
|
9798
9815
|
str = String(str);
|
|
9799
9816
|
if (str.length > 100) {
|
|
9800
9817
|
return;
|
|
9801
9818
|
}
|
|
9802
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
9819
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
9820
|
+
str
|
|
9821
|
+
);
|
|
9803
9822
|
if (!match) {
|
|
9804
9823
|
return;
|
|
9805
9824
|
}
|
|
@@ -12739,7 +12758,7 @@ var require_dist_node18 = __commonJS({
|
|
|
12739
12758
|
parse
|
|
12740
12759
|
});
|
|
12741
12760
|
}
|
|
12742
|
-
var VERSION = "7.0.
|
|
12761
|
+
var VERSION = "7.0.1";
|
|
12743
12762
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
12744
12763
|
var DEFAULTS = {
|
|
12745
12764
|
method: "GET",
|
|
@@ -12825,7 +12844,7 @@ var require_dist_node20 = __commonJS({
|
|
|
12825
12844
|
var isPlainObject = require_is_plain_object();
|
|
12826
12845
|
var nodeFetch = _interopDefault(require_lib3());
|
|
12827
12846
|
var requestError = require_dist_node19();
|
|
12828
|
-
var VERSION = "6.2.
|
|
12847
|
+
var VERSION = "6.2.1";
|
|
12829
12848
|
function getBufferResponse(response) {
|
|
12830
12849
|
return response.arrayBuffer();
|
|
12831
12850
|
}
|
|
@@ -12838,12 +12857,15 @@ var require_dist_node20 = __commonJS({
|
|
|
12838
12857
|
let status;
|
|
12839
12858
|
let url;
|
|
12840
12859
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
12841
|
-
return fetch(requestOptions.url, Object.assign(
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12860
|
+
return fetch(requestOptions.url, Object.assign(
|
|
12861
|
+
{
|
|
12862
|
+
method: requestOptions.method,
|
|
12863
|
+
body: requestOptions.body,
|
|
12864
|
+
headers: requestOptions.headers,
|
|
12865
|
+
redirect: requestOptions.redirect
|
|
12866
|
+
},
|
|
12867
|
+
requestOptions.request
|
|
12868
|
+
)).then(async (response) => {
|
|
12847
12869
|
url = response.url;
|
|
12848
12870
|
status = response.status;
|
|
12849
12871
|
for (const keyAndValue of response.headers) {
|
|
@@ -14096,7 +14118,9 @@ var require_dist_node25 = __commonJS({
|
|
|
14096
14118
|
case "app":
|
|
14097
14119
|
return getAppAuthentication(state);
|
|
14098
14120
|
case "oauth":
|
|
14099
|
-
state.log.warn(
|
|
14121
|
+
state.log.warn(
|
|
14122
|
+
new deprecation.Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`)
|
|
14123
|
+
);
|
|
14100
14124
|
case "oauth-app":
|
|
14101
14125
|
return state.oauthApp({
|
|
14102
14126
|
type: "oauth-app"
|
|
@@ -14169,7 +14193,11 @@ var require_dist_node25 = __commonJS({
|
|
|
14169
14193
|
const {
|
|
14170
14194
|
token,
|
|
14171
14195
|
createdAt
|
|
14172
|
-
} = await getInstallationAuthentication(
|
|
14196
|
+
} = await getInstallationAuthentication(
|
|
14197
|
+
state,
|
|
14198
|
+
{},
|
|
14199
|
+
request2
|
|
14200
|
+
);
|
|
14173
14201
|
endpoint.headers.authorization = `token ${token}`;
|
|
14174
14202
|
return sendRequestWithRetries(state, request2, endpoint, createdAt);
|
|
14175
14203
|
}
|
|
@@ -14690,6 +14718,8 @@ function baseUrlFromDomain(domain) {
|
|
|
14690
14718
|
}
|
|
14691
14719
|
|
|
14692
14720
|
// src/lambdas/status/index.ts
|
|
14721
|
+
var cfn = new AWS2.CloudFormation();
|
|
14722
|
+
var ecr = new AWS2.ECR();
|
|
14693
14723
|
var sf = new AWS2.StepFunctions();
|
|
14694
14724
|
function secretArnToUrl(arn) {
|
|
14695
14725
|
const parts = arn.split(":");
|
|
@@ -14709,8 +14739,36 @@ function stepFunctionArnToUrl(arn) {
|
|
|
14709
14739
|
const region = parts[3];
|
|
14710
14740
|
return `https://${region}.console.aws.amazon.com/states/home?region=${region}#/statemachines/view/${arn}`;
|
|
14711
14741
|
}
|
|
14742
|
+
async function generateProvidersStatus(stack, logicalId) {
|
|
14743
|
+
var _a;
|
|
14744
|
+
const resource = await cfn.describeStackResource({ StackName: stack, LogicalResourceId: logicalId }).promise();
|
|
14745
|
+
const providers = JSON.parse(((_a = resource.StackResourceDetail) == null ? void 0 : _a.Metadata) ?? "{}").providers;
|
|
14746
|
+
if (!providers) {
|
|
14747
|
+
return {};
|
|
14748
|
+
}
|
|
14749
|
+
return Promise.all(providers.map(async (p) => {
|
|
14750
|
+
var _a2, _b, _c;
|
|
14751
|
+
if ((_b = (_a2 = p.image) == null ? void 0 : _a2.imageRepository) == null ? void 0 : _b.match(/[0-9]+\.dkr\.ecr\.[a-z0-9\-]+\.amazonaws\.com\/.+/)) {
|
|
14752
|
+
const tags = await ecr.describeImages({
|
|
14753
|
+
repositoryName: p.image.imageRepository.split("/")[1],
|
|
14754
|
+
filter: {
|
|
14755
|
+
tagStatus: "TAGGED"
|
|
14756
|
+
},
|
|
14757
|
+
maxResults: 1
|
|
14758
|
+
}).promise();
|
|
14759
|
+
if (tags.imageDetails && ((_c = tags.imageDetails) == null ? void 0 : _c.length) >= 1) {
|
|
14760
|
+
p.image.latestImage = {
|
|
14761
|
+
tags: tags.imageDetails[0].imageTags,
|
|
14762
|
+
digest: tags.imageDetails[0].imageDigest,
|
|
14763
|
+
date: tags.imageDetails[0].imagePushedAt
|
|
14764
|
+
};
|
|
14765
|
+
}
|
|
14766
|
+
}
|
|
14767
|
+
return p;
|
|
14768
|
+
}));
|
|
14769
|
+
}
|
|
14712
14770
|
exports.handler = async function() {
|
|
14713
|
-
if (!process.env.WEBHOOK_SECRET_ARN || !process.env.GITHUB_SECRET_ARN || !process.env.GITHUB_PRIVATE_KEY_SECRET_ARN || !process.env.
|
|
14771
|
+
if (!process.env.WEBHOOK_SECRET_ARN || !process.env.GITHUB_SECRET_ARN || !process.env.GITHUB_PRIVATE_KEY_SECRET_ARN || !process.env.LOGICAL_ID || !process.env.WEBHOOK_HANDLER_ARN || !process.env.STEP_FUNCTION_ARN || !process.env.SETUP_SECRET_ARN || !process.env.SETUP_FUNCTION_URL || !process.env.STACK_NAME) {
|
|
14714
14772
|
throw new Error("Missing environment variables");
|
|
14715
14773
|
}
|
|
14716
14774
|
const status = {
|
|
@@ -14743,7 +14801,7 @@ exports.handler = async function() {
|
|
|
14743
14801
|
personalAuthToken: ""
|
|
14744
14802
|
}
|
|
14745
14803
|
},
|
|
14746
|
-
providers:
|
|
14804
|
+
providers: await generateProvidersStatus(process.env.STACK_NAME, process.env.LOGICAL_ID),
|
|
14747
14805
|
troubleshooting: {
|
|
14748
14806
|
webhookHandlerArn: process.env.WEBHOOK_HANDLER_ARN,
|
|
14749
14807
|
webhookHandlerUrl: lambdaArnToUrl(process.env.WEBHOOK_HANDLER_ARN),
|
|
@@ -14844,7 +14902,7 @@ exports.handler = async function() {
|
|
|
14844
14902
|
for (const installation of installations) {
|
|
14845
14903
|
let installationDetails = {
|
|
14846
14904
|
id: installation.id,
|
|
14847
|
-
url:
|
|
14905
|
+
url: installation.html_url,
|
|
14848
14906
|
status: "Unable to query",
|
|
14849
14907
|
repositories: []
|
|
14850
14908
|
};
|
|
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
20
23
|
|
|
21
24
|
// node_modules/universal-user-agent/dist-node/index.js
|
|
22
25
|
var require_dist_node = __commonJS({
|
|
@@ -5951,11 +5954,14 @@ var require_lib3 = __commonJS({
|
|
|
5951
5954
|
blob() {
|
|
5952
5955
|
let ct = this.headers && this.headers.get("content-type") || "";
|
|
5953
5956
|
return consumeBody.call(this).then(function(buf) {
|
|
5954
|
-
return Object.assign(
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5957
|
+
return Object.assign(
|
|
5958
|
+
new Blob([], {
|
|
5959
|
+
type: ct.toLowerCase()
|
|
5960
|
+
}),
|
|
5961
|
+
{
|
|
5962
|
+
[BUFFER]: buf
|
|
5963
|
+
}
|
|
5964
|
+
);
|
|
5959
5965
|
});
|
|
5960
5966
|
},
|
|
5961
5967
|
json() {
|
|
@@ -7012,12 +7018,15 @@ var require_dist_node5 = __commonJS({
|
|
|
7012
7018
|
let status;
|
|
7013
7019
|
let url;
|
|
7014
7020
|
const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
|
|
7015
|
-
return fetch(requestOptions.url, Object.assign(
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
+
return fetch(requestOptions.url, Object.assign(
|
|
7022
|
+
{
|
|
7023
|
+
method: requestOptions.method,
|
|
7024
|
+
body: requestOptions.body,
|
|
7025
|
+
headers: requestOptions.headers,
|
|
7026
|
+
redirect: requestOptions.redirect
|
|
7027
|
+
},
|
|
7028
|
+
requestOptions.request
|
|
7029
|
+
)).then(async (response) => {
|
|
7021
7030
|
url = response.url;
|
|
7022
7031
|
status = response.status;
|
|
7023
7032
|
for (const keyAndValue of response.headers) {
|
|
@@ -7425,7 +7434,7 @@ var require_dist_node6 = __commonJS({
|
|
|
7425
7434
|
parse
|
|
7426
7435
|
});
|
|
7427
7436
|
}
|
|
7428
|
-
var VERSION = "7.0.
|
|
7437
|
+
var VERSION = "7.0.1";
|
|
7429
7438
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
7430
7439
|
var DEFAULTS = {
|
|
7431
7440
|
method: "GET",
|
|
@@ -7511,7 +7520,7 @@ var require_dist_node8 = __commonJS({
|
|
|
7511
7520
|
var isPlainObject = require_is_plain_object();
|
|
7512
7521
|
var nodeFetch = _interopDefault(require_lib3());
|
|
7513
7522
|
var requestError = require_dist_node7();
|
|
7514
|
-
var VERSION = "6.2.
|
|
7523
|
+
var VERSION = "6.2.1";
|
|
7515
7524
|
function getBufferResponse(response) {
|
|
7516
7525
|
return response.arrayBuffer();
|
|
7517
7526
|
}
|
|
@@ -7524,12 +7533,15 @@ var require_dist_node8 = __commonJS({
|
|
|
7524
7533
|
let status;
|
|
7525
7534
|
let url;
|
|
7526
7535
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
7527
|
-
return fetch(requestOptions.url, Object.assign(
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7536
|
+
return fetch(requestOptions.url, Object.assign(
|
|
7537
|
+
{
|
|
7538
|
+
method: requestOptions.method,
|
|
7539
|
+
body: requestOptions.body,
|
|
7540
|
+
headers: requestOptions.headers,
|
|
7541
|
+
redirect: requestOptions.redirect
|
|
7542
|
+
},
|
|
7543
|
+
requestOptions.request
|
|
7544
|
+
)).then(async (response) => {
|
|
7533
7545
|
url = response.url;
|
|
7534
7546
|
status = response.status;
|
|
7535
7547
|
for (const keyAndValue of response.headers) {
|
|
@@ -7980,7 +7992,7 @@ var require_dist_node10 = __commonJS({
|
|
|
7980
7992
|
parse
|
|
7981
7993
|
});
|
|
7982
7994
|
}
|
|
7983
|
-
var VERSION = "7.0.
|
|
7995
|
+
var VERSION = "7.0.1";
|
|
7984
7996
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
7985
7997
|
var DEFAULTS = {
|
|
7986
7998
|
method: "GET",
|
|
@@ -8066,7 +8078,7 @@ var require_dist_node12 = __commonJS({
|
|
|
8066
8078
|
var isPlainObject = require_is_plain_object();
|
|
8067
8079
|
var nodeFetch = _interopDefault(require_lib3());
|
|
8068
8080
|
var requestError = require_dist_node11();
|
|
8069
|
-
var VERSION = "6.2.
|
|
8081
|
+
var VERSION = "6.2.1";
|
|
8070
8082
|
function getBufferResponse(response) {
|
|
8071
8083
|
return response.arrayBuffer();
|
|
8072
8084
|
}
|
|
@@ -8079,12 +8091,15 @@ var require_dist_node12 = __commonJS({
|
|
|
8079
8091
|
let status;
|
|
8080
8092
|
let url;
|
|
8081
8093
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
8082
|
-
return fetch(requestOptions.url, Object.assign(
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8094
|
+
return fetch(requestOptions.url, Object.assign(
|
|
8095
|
+
{
|
|
8096
|
+
method: requestOptions.method,
|
|
8097
|
+
body: requestOptions.body,
|
|
8098
|
+
headers: requestOptions.headers,
|
|
8099
|
+
redirect: requestOptions.redirect
|
|
8100
|
+
},
|
|
8101
|
+
requestOptions.request
|
|
8102
|
+
)).then(async (response) => {
|
|
8088
8103
|
url = response.url;
|
|
8089
8104
|
status = response.status;
|
|
8090
8105
|
for (const keyAndValue of response.headers) {
|
|
@@ -8565,7 +8580,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8565
8580
|
endpoint.headers.authorization = `token ${token}`;
|
|
8566
8581
|
return request2(endpoint);
|
|
8567
8582
|
}
|
|
8568
|
-
var VERSION = "4.0.
|
|
8583
|
+
var VERSION = "4.0.1";
|
|
8569
8584
|
function createOAuthDeviceAuth(options) {
|
|
8570
8585
|
const requestWithDefaults = options.request || request.request.defaults({
|
|
8571
8586
|
headers: {
|
|
@@ -8613,7 +8628,7 @@ var require_dist_node15 = __commonJS({
|
|
|
8613
8628
|
var authOauthDevice = require_dist_node14();
|
|
8614
8629
|
var oauthMethods = require_dist_node13();
|
|
8615
8630
|
var btoa = _interopDefault(require_btoa_node());
|
|
8616
|
-
var VERSION = "2.0.
|
|
8631
|
+
var VERSION = "2.0.3";
|
|
8617
8632
|
async function getAuthentication(state) {
|
|
8618
8633
|
if ("code" in state.strategyOptions) {
|
|
8619
8634
|
const {
|
|
@@ -9792,14 +9807,18 @@ var require_ms = __commonJS({
|
|
|
9792
9807
|
} else if (type === "number" && isFinite(val)) {
|
|
9793
9808
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
9794
9809
|
}
|
|
9795
|
-
throw new Error(
|
|
9810
|
+
throw new Error(
|
|
9811
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
9812
|
+
);
|
|
9796
9813
|
};
|
|
9797
9814
|
function parse(str) {
|
|
9798
9815
|
str = String(str);
|
|
9799
9816
|
if (str.length > 100) {
|
|
9800
9817
|
return;
|
|
9801
9818
|
}
|
|
9802
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
9819
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
9820
|
+
str
|
|
9821
|
+
);
|
|
9803
9822
|
if (!match) {
|
|
9804
9823
|
return;
|
|
9805
9824
|
}
|
|
@@ -12739,7 +12758,7 @@ var require_dist_node18 = __commonJS({
|
|
|
12739
12758
|
parse
|
|
12740
12759
|
});
|
|
12741
12760
|
}
|
|
12742
|
-
var VERSION = "7.0.
|
|
12761
|
+
var VERSION = "7.0.1";
|
|
12743
12762
|
var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
|
|
12744
12763
|
var DEFAULTS = {
|
|
12745
12764
|
method: "GET",
|
|
@@ -12825,7 +12844,7 @@ var require_dist_node20 = __commonJS({
|
|
|
12825
12844
|
var isPlainObject = require_is_plain_object();
|
|
12826
12845
|
var nodeFetch = _interopDefault(require_lib3());
|
|
12827
12846
|
var requestError = require_dist_node19();
|
|
12828
|
-
var VERSION = "6.2.
|
|
12847
|
+
var VERSION = "6.2.1";
|
|
12829
12848
|
function getBufferResponse(response) {
|
|
12830
12849
|
return response.arrayBuffer();
|
|
12831
12850
|
}
|
|
@@ -12838,12 +12857,15 @@ var require_dist_node20 = __commonJS({
|
|
|
12838
12857
|
let status;
|
|
12839
12858
|
let url;
|
|
12840
12859
|
const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
|
|
12841
|
-
return fetch(requestOptions.url, Object.assign(
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12860
|
+
return fetch(requestOptions.url, Object.assign(
|
|
12861
|
+
{
|
|
12862
|
+
method: requestOptions.method,
|
|
12863
|
+
body: requestOptions.body,
|
|
12864
|
+
headers: requestOptions.headers,
|
|
12865
|
+
redirect: requestOptions.redirect
|
|
12866
|
+
},
|
|
12867
|
+
requestOptions.request
|
|
12868
|
+
)).then(async (response) => {
|
|
12847
12869
|
url = response.url;
|
|
12848
12870
|
status = response.status;
|
|
12849
12871
|
for (const keyAndValue of response.headers) {
|
|
@@ -14096,7 +14118,9 @@ var require_dist_node25 = __commonJS({
|
|
|
14096
14118
|
case "app":
|
|
14097
14119
|
return getAppAuthentication(state);
|
|
14098
14120
|
case "oauth":
|
|
14099
|
-
state.log.warn(
|
|
14121
|
+
state.log.warn(
|
|
14122
|
+
new deprecation.Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`)
|
|
14123
|
+
);
|
|
14100
14124
|
case "oauth-app":
|
|
14101
14125
|
return state.oauthApp({
|
|
14102
14126
|
type: "oauth-app"
|
|
@@ -14169,7 +14193,11 @@ var require_dist_node25 = __commonJS({
|
|
|
14169
14193
|
const {
|
|
14170
14194
|
token,
|
|
14171
14195
|
createdAt
|
|
14172
|
-
} = await getInstallationAuthentication(
|
|
14196
|
+
} = await getInstallationAuthentication(
|
|
14197
|
+
state,
|
|
14198
|
+
{},
|
|
14199
|
+
request2
|
|
14200
|
+
);
|
|
14173
14201
|
endpoint.headers.authorization = `token ${token}`;
|
|
14174
14202
|
return sendRequestWithRetries(state, request2, endpoint, createdAt);
|
|
14175
14203
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
|
|
23
26
|
// src/lambdas/update-lambda/index.ts
|
|
@@ -31,7 +34,7 @@ var cfn = new AWS.CloudFormation();
|
|
|
31
34
|
var lambda = new AWS.Lambda();
|
|
32
35
|
async function handler(event) {
|
|
33
36
|
var _a;
|
|
34
|
-
console.log(event);
|
|
37
|
+
console.log(JSON.stringify(event));
|
|
35
38
|
const stacks = await cfn.describeStacks({
|
|
36
39
|
StackName: event.stackName
|
|
37
40
|
}).promise();
|
|
@@ -13,7 +13,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
13
|
}
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
17
20
|
|
|
18
21
|
// src/lambdas/webhook-handler/index.ts
|
|
19
22
|
var crypto = __toESM(require("crypto"));
|
|
@@ -40,11 +43,14 @@ async function getSecretJsonValue(arn) {
|
|
|
40
43
|
var sf = new AWS2.StepFunctions();
|
|
41
44
|
function verifyBody(event, secret) {
|
|
42
45
|
const sig = Buffer.from(event.headers["x-hub-signature-256"] || "", "utf8");
|
|
43
|
-
|
|
46
|
+
if (!event.body) {
|
|
47
|
+
throw new Error("No body");
|
|
48
|
+
}
|
|
49
|
+
let body;
|
|
44
50
|
if (event.isBase64Encoded) {
|
|
45
|
-
body = Buffer.from(body, "base64");
|
|
51
|
+
body = Buffer.from(event.body, "base64");
|
|
46
52
|
} else {
|
|
47
|
-
body = Buffer.from(body || "", "utf8");
|
|
53
|
+
body = Buffer.from(event.body || "", "utf8");
|
|
48
54
|
}
|
|
49
55
|
const hmac = crypto.createHmac("sha256", secret);
|
|
50
56
|
hmac.update(body);
|
|
@@ -53,7 +59,7 @@ function verifyBody(event, secret) {
|
|
|
53
59
|
if (sig.length !== expectedSig.length || !crypto.timingSafeEqual(sig, expectedSig)) {
|
|
54
60
|
throw new Error(`Signature mismatch. Expected ${expectedSig.toString()} but got ${sig.toString()}`);
|
|
55
61
|
}
|
|
56
|
-
return body;
|
|
62
|
+
return body.toString();
|
|
57
63
|
}
|
|
58
64
|
exports.handler = async function(event) {
|
|
59
65
|
var _a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { aws_codebuild as codebuild, aws_ec2 as ec2, aws_iam as iam, aws_stepfunctions as stepfunctions, Duration } from 'aws-cdk-lib';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
|
-
import { IImageBuilder, IRunnerProvider, RunnerProviderProps, RunnerRuntimeParameters } from './common';
|
|
3
|
+
import { IImageBuilder, IRunnerProvider, RunnerImage, RunnerProviderProps, RunnerRuntimeParameters } from './common';
|
|
4
4
|
export interface CodeBuildRunnerProps extends RunnerProviderProps {
|
|
5
5
|
/**
|
|
6
6
|
* Provider running an image to run inside CodeBuild with GitHub runner pre-configured. A user named `runner` is expected to exist with access to Docker-in-Docker.
|
|
@@ -100,6 +100,10 @@ export declare class CodeBuildRunner extends Construct implements IRunnerProvide
|
|
|
100
100
|
* Grant principal used to add permissions to the runner role.
|
|
101
101
|
*/
|
|
102
102
|
readonly grantPrincipal: iam.IPrincipal;
|
|
103
|
+
/**
|
|
104
|
+
* Docker image in CodeBuild project.
|
|
105
|
+
*/
|
|
106
|
+
readonly image: RunnerImage;
|
|
103
107
|
constructor(scope: Construct, id: string, props: CodeBuildRunnerProps);
|
|
104
108
|
/**
|
|
105
109
|
* Generate step function task(s) to start a new runner.
|