@cloudsnorkel/cdk-github-runners 0.3.2 → 0.5.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.
Files changed (35) hide show
  1. package/.gitattributes +1 -0
  2. package/.jsii +1413 -431
  3. package/API.md +1082 -126
  4. package/README.md +12 -10
  5. package/lib/index.d.ts +2 -1
  6. package/lib/index.js +4 -1
  7. package/lib/lambdas/aws-image-builder-versioner/index.js +2469 -0
  8. package/lib/lambdas/build-image/index.js +77 -43
  9. package/lib/lambdas/delete-runner/index.js +114 -79
  10. package/lib/lambdas/setup/index.html +10 -10
  11. package/lib/lambdas/setup/index.js +27 -12
  12. package/lib/lambdas/status/index.js +147 -82
  13. package/lib/lambdas/token-retriever/index.js +114 -79
  14. package/lib/lambdas/update-lambda/index.js +5 -2
  15. package/lib/lambdas/webhook-handler/index.js +11 -5
  16. package/lib/providers/codebuild.d.ts +5 -1
  17. package/lib/providers/codebuild.js +16 -6
  18. package/lib/providers/common.d.ts +25 -6
  19. package/lib/providers/common.js +4 -4
  20. package/lib/providers/docker-images/fargate/linux-arm64/Dockerfile +0 -2
  21. package/lib/providers/docker-images/fargate/linux-x64/Dockerfile +0 -3
  22. package/lib/providers/fargate.d.ts +6 -1
  23. package/lib/providers/fargate.js +56 -15
  24. package/lib/providers/image-builders/codebuild.d.ts +6 -2
  25. package/lib/providers/image-builders/codebuild.js +14 -11
  26. package/lib/providers/image-builders/container.d.ts +220 -0
  27. package/lib/providers/image-builders/container.js +509 -0
  28. package/lib/providers/image-builders/static.js +2 -3
  29. package/lib/providers/lambda.d.ts +6 -1
  30. package/lib/providers/lambda.js +79 -8
  31. package/lib/runner.js +29 -13
  32. package/lib/secrets.js +1 -1
  33. package/package.json +16 -12
  34. package/lib/providers/docker-images/fargate/linux-arm64/runner.sh +0 -5
  35. package/lib/providers/docker-images/fargate/linux-x64/runner.sh +0 -5
@@ -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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
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({
@@ -6089,11 +6092,14 @@ var require_lib3 = __commonJS({
6089
6092
  blob() {
6090
6093
  let ct = this.headers && this.headers.get("content-type") || "";
6091
6094
  return consumeBody.call(this).then(function(buf) {
6092
- return Object.assign(new Blob([], {
6093
- type: ct.toLowerCase()
6094
- }), {
6095
- [BUFFER]: buf
6096
- });
6095
+ return Object.assign(
6096
+ new Blob([], {
6097
+ type: ct.toLowerCase()
6098
+ }),
6099
+ {
6100
+ [BUFFER]: buf
6101
+ }
6102
+ );
6097
6103
  });
6098
6104
  },
6099
6105
  json() {
@@ -7150,12 +7156,15 @@ var require_dist_node5 = __commonJS({
7150
7156
  let status;
7151
7157
  let url;
7152
7158
  const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
7153
- return fetch(requestOptions.url, Object.assign({
7154
- method: requestOptions.method,
7155
- body: requestOptions.body,
7156
- headers: requestOptions.headers,
7157
- redirect: requestOptions.redirect
7158
- }, requestOptions.request)).then(async (response2) => {
7159
+ return fetch(requestOptions.url, Object.assign(
7160
+ {
7161
+ method: requestOptions.method,
7162
+ body: requestOptions.body,
7163
+ headers: requestOptions.headers,
7164
+ redirect: requestOptions.redirect
7165
+ },
7166
+ requestOptions.request
7167
+ )).then(async (response2) => {
7159
7168
  url = response2.url;
7160
7169
  status = response2.status;
7161
7170
  for (const keyAndValue of response2.headers) {
@@ -8885,6 +8894,9 @@ async function handleRoot(event, setupToken) {
8885
8894
  }
8886
8895
  function decodeBody(event) {
8887
8896
  let body = event.body;
8897
+ if (!body) {
8898
+ throw new Error("No body found");
8899
+ }
8888
8900
  if (event.isBase64Encoded) {
8889
8901
  body = Buffer.from(body, "base64").toString("utf-8");
8890
8902
  }
@@ -8914,6 +8926,9 @@ async function handlePat(event) {
8914
8926
  return response(200, "Personal access token set");
8915
8927
  }
8916
8928
  async function handleNewApp(event) {
8929
+ if (!event.queryStringParameters) {
8930
+ return response(400, "Invalid code");
8931
+ }
8917
8932
  const code = event.queryStringParameters.code;
8918
8933
  if (!code) {
8919
8934
  return response(400, "Invalid code");
@@ -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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
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(new Blob([], {
5955
- type: ct.toLowerCase()
5956
- }), {
5957
- [BUFFER]: buf
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
- method: requestOptions.method,
7017
- body: requestOptions.body,
7018
- headers: requestOptions.headers,
7019
- redirect: requestOptions.redirect
7020
- }, requestOptions.request)).then(async (response) => {
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) {
@@ -7391,8 +7400,6 @@ var require_dist_node6 = __commonJS({
7391
7400
  } else {
7392
7401
  if (Object.keys(remainingParameters).length) {
7393
7402
  body = remainingParameters;
7394
- } else {
7395
- headers["content-length"] = 0;
7396
7403
  }
7397
7404
  }
7398
7405
  }
@@ -7425,7 +7432,7 @@ var require_dist_node6 = __commonJS({
7425
7432
  parse
7426
7433
  });
7427
7434
  }
7428
- var VERSION = "7.0.0";
7435
+ var VERSION = "7.0.2";
7429
7436
  var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
7430
7437
  var DEFAULTS = {
7431
7438
  method: "GET",
@@ -7511,7 +7518,7 @@ var require_dist_node8 = __commonJS({
7511
7518
  var isPlainObject = require_is_plain_object();
7512
7519
  var nodeFetch = _interopDefault(require_lib3());
7513
7520
  var requestError = require_dist_node7();
7514
- var VERSION = "6.2.0";
7521
+ var VERSION = "6.2.1";
7515
7522
  function getBufferResponse(response) {
7516
7523
  return response.arrayBuffer();
7517
7524
  }
@@ -7524,12 +7531,15 @@ var require_dist_node8 = __commonJS({
7524
7531
  let status;
7525
7532
  let url;
7526
7533
  const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
7527
- return fetch(requestOptions.url, Object.assign({
7528
- method: requestOptions.method,
7529
- body: requestOptions.body,
7530
- headers: requestOptions.headers,
7531
- redirect: requestOptions.redirect
7532
- }, requestOptions.request)).then(async (response) => {
7534
+ return fetch(requestOptions.url, Object.assign(
7535
+ {
7536
+ method: requestOptions.method,
7537
+ body: requestOptions.body,
7538
+ headers: requestOptions.headers,
7539
+ redirect: requestOptions.redirect
7540
+ },
7541
+ requestOptions.request
7542
+ )).then(async (response) => {
7533
7543
  url = response.url;
7534
7544
  status = response.status;
7535
7545
  for (const keyAndValue of response.headers) {
@@ -7946,8 +7956,6 @@ var require_dist_node10 = __commonJS({
7946
7956
  } else {
7947
7957
  if (Object.keys(remainingParameters).length) {
7948
7958
  body = remainingParameters;
7949
- } else {
7950
- headers["content-length"] = 0;
7951
7959
  }
7952
7960
  }
7953
7961
  }
@@ -7980,7 +7988,7 @@ var require_dist_node10 = __commonJS({
7980
7988
  parse
7981
7989
  });
7982
7990
  }
7983
- var VERSION = "7.0.0";
7991
+ var VERSION = "7.0.2";
7984
7992
  var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
7985
7993
  var DEFAULTS = {
7986
7994
  method: "GET",
@@ -8066,7 +8074,7 @@ var require_dist_node12 = __commonJS({
8066
8074
  var isPlainObject = require_is_plain_object();
8067
8075
  var nodeFetch = _interopDefault(require_lib3());
8068
8076
  var requestError = require_dist_node11();
8069
- var VERSION = "6.2.0";
8077
+ var VERSION = "6.2.1";
8070
8078
  function getBufferResponse(response) {
8071
8079
  return response.arrayBuffer();
8072
8080
  }
@@ -8079,12 +8087,15 @@ var require_dist_node12 = __commonJS({
8079
8087
  let status;
8080
8088
  let url;
8081
8089
  const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
8082
- return fetch(requestOptions.url, Object.assign({
8083
- method: requestOptions.method,
8084
- body: requestOptions.body,
8085
- headers: requestOptions.headers,
8086
- redirect: requestOptions.redirect
8087
- }, requestOptions.request)).then(async (response) => {
8090
+ return fetch(requestOptions.url, Object.assign(
8091
+ {
8092
+ method: requestOptions.method,
8093
+ body: requestOptions.body,
8094
+ headers: requestOptions.headers,
8095
+ redirect: requestOptions.redirect
8096
+ },
8097
+ requestOptions.request
8098
+ )).then(async (response) => {
8088
8099
  url = response.url;
8089
8100
  status = response.status;
8090
8101
  for (const keyAndValue of response.headers) {
@@ -8217,7 +8228,7 @@ var require_dist_node13 = __commonJS({
8217
8228
  var request = require_dist_node12();
8218
8229
  var requestError = require_dist_node11();
8219
8230
  var btoa = _interopDefault(require_btoa_node());
8220
- var VERSION = "2.0.2";
8231
+ var VERSION = "2.0.3";
8221
8232
  function requestToOAuthBaseUrl(request2) {
8222
8233
  const endpointDefaults = request2.endpoint.DEFAULTS;
8223
8234
  return /^https:\/\/(api\.)?github\.com$/.test(endpointDefaults.baseUrl) ? "https://github.com" : endpointDefaults.baseUrl.replace("/api/v3", "");
@@ -8376,21 +8387,25 @@ var require_dist_node13 = __commonJS({
8376
8387
  }
8377
8388
  async function scopeToken(options) {
8378
8389
  const {
8379
- request: request$1,
8390
+ request: optionsRequest,
8380
8391
  clientType,
8381
8392
  clientId,
8382
8393
  clientSecret,
8383
8394
  token,
8384
8395
  ...requestOptions
8385
8396
  } = options;
8386
- const response = await (request$1 || request.request)("POST /applications/{client_id}/token/scoped", {
8387
- headers: {
8388
- authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`
8389
- },
8390
- client_id: clientId,
8391
- access_token: token,
8392
- ...requestOptions
8393
- });
8397
+ const request$1 = optionsRequest || request.request;
8398
+ const response = await request$1(
8399
+ "POST /applications/{client_id}/token/scoped",
8400
+ {
8401
+ headers: {
8402
+ authorization: `basic ${btoa(`${clientId}:${clientSecret}`)}`
8403
+ },
8404
+ client_id: clientId,
8405
+ access_token: token,
8406
+ ...requestOptions
8407
+ }
8408
+ );
8394
8409
  const authentication = Object.assign({
8395
8410
  clientType,
8396
8411
  clientId,
@@ -8407,13 +8422,16 @@ var require_dist_node13 = __commonJS({
8407
8422
  async function resetToken(options) {
8408
8423
  const request$1 = options.request || request.request;
8409
8424
  const auth = btoa(`${options.clientId}:${options.clientSecret}`);
8410
- const response = await request$1("PATCH /applications/{client_id}/token", {
8411
- headers: {
8412
- authorization: `basic ${auth}`
8413
- },
8414
- client_id: options.clientId,
8415
- access_token: options.token
8416
- });
8425
+ const response = await request$1(
8426
+ "PATCH /applications/{client_id}/token",
8427
+ {
8428
+ headers: {
8429
+ authorization: `basic ${auth}`
8430
+ },
8431
+ client_id: options.clientId,
8432
+ access_token: options.token
8433
+ }
8434
+ );
8417
8435
  const authentication = {
8418
8436
  clientType: options.clientType,
8419
8437
  clientId: options.clientId,
@@ -8434,24 +8452,30 @@ var require_dist_node13 = __commonJS({
8434
8452
  async function deleteToken(options) {
8435
8453
  const request$1 = options.request || request.request;
8436
8454
  const auth = btoa(`${options.clientId}:${options.clientSecret}`);
8437
- return request$1("DELETE /applications/{client_id}/token", {
8438
- headers: {
8439
- authorization: `basic ${auth}`
8440
- },
8441
- client_id: options.clientId,
8442
- access_token: options.token
8443
- });
8455
+ return request$1(
8456
+ "DELETE /applications/{client_id}/token",
8457
+ {
8458
+ headers: {
8459
+ authorization: `basic ${auth}`
8460
+ },
8461
+ client_id: options.clientId,
8462
+ access_token: options.token
8463
+ }
8464
+ );
8444
8465
  }
8445
8466
  async function deleteAuthorization(options) {
8446
8467
  const request$1 = options.request || request.request;
8447
8468
  const auth = btoa(`${options.clientId}:${options.clientSecret}`);
8448
- return request$1("DELETE /applications/{client_id}/grant", {
8449
- headers: {
8450
- authorization: `basic ${auth}`
8451
- },
8452
- client_id: options.clientId,
8453
- access_token: options.token
8454
- });
8469
+ return request$1(
8470
+ "DELETE /applications/{client_id}/grant",
8471
+ {
8472
+ headers: {
8473
+ authorization: `basic ${auth}`
8474
+ },
8475
+ client_id: options.clientId,
8476
+ access_token: options.token
8477
+ }
8478
+ );
8455
8479
  }
8456
8480
  exports2.VERSION = VERSION;
8457
8481
  exports2.checkToken = checkToken;
@@ -8565,7 +8589,7 @@ var require_dist_node14 = __commonJS({
8565
8589
  endpoint.headers.authorization = `token ${token}`;
8566
8590
  return request2(endpoint);
8567
8591
  }
8568
- var VERSION = "4.0.0";
8592
+ var VERSION = "4.0.2";
8569
8593
  function createOAuthDeviceAuth(options) {
8570
8594
  const requestWithDefaults = options.request || request.request.defaults({
8571
8595
  headers: {
@@ -8613,7 +8637,7 @@ var require_dist_node15 = __commonJS({
8613
8637
  var authOauthDevice = require_dist_node14();
8614
8638
  var oauthMethods = require_dist_node13();
8615
8639
  var btoa = _interopDefault(require_btoa_node());
8616
- var VERSION = "2.0.2";
8640
+ var VERSION = "2.0.3";
8617
8641
  async function getAuthentication(state) {
8618
8642
  if ("code" in state.strategyOptions) {
8619
8643
  const {
@@ -9792,14 +9816,18 @@ var require_ms = __commonJS({
9792
9816
  } else if (type === "number" && isFinite(val)) {
9793
9817
  return options.long ? fmtLong(val) : fmtShort(val);
9794
9818
  }
9795
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
9819
+ throw new Error(
9820
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
9821
+ );
9796
9822
  };
9797
9823
  function parse(str) {
9798
9824
  str = String(str);
9799
9825
  if (str.length > 100) {
9800
9826
  return;
9801
9827
  }
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(str);
9828
+ 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(
9829
+ str
9830
+ );
9803
9831
  if (!match) {
9804
9832
  return;
9805
9833
  }
@@ -12705,8 +12733,6 @@ var require_dist_node18 = __commonJS({
12705
12733
  } else {
12706
12734
  if (Object.keys(remainingParameters).length) {
12707
12735
  body = remainingParameters;
12708
- } else {
12709
- headers["content-length"] = 0;
12710
12736
  }
12711
12737
  }
12712
12738
  }
@@ -12739,7 +12765,7 @@ var require_dist_node18 = __commonJS({
12739
12765
  parse
12740
12766
  });
12741
12767
  }
12742
- var VERSION = "7.0.0";
12768
+ var VERSION = "7.0.2";
12743
12769
  var userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
12744
12770
  var DEFAULTS = {
12745
12771
  method: "GET",
@@ -12825,7 +12851,7 @@ var require_dist_node20 = __commonJS({
12825
12851
  var isPlainObject = require_is_plain_object();
12826
12852
  var nodeFetch = _interopDefault(require_lib3());
12827
12853
  var requestError = require_dist_node19();
12828
- var VERSION = "6.2.0";
12854
+ var VERSION = "6.2.1";
12829
12855
  function getBufferResponse(response) {
12830
12856
  return response.arrayBuffer();
12831
12857
  }
@@ -12838,12 +12864,15 @@ var require_dist_node20 = __commonJS({
12838
12864
  let status;
12839
12865
  let url;
12840
12866
  const fetch = requestOptions.request && requestOptions.request.fetch || globalThis.fetch || nodeFetch;
12841
- return fetch(requestOptions.url, Object.assign({
12842
- method: requestOptions.method,
12843
- body: requestOptions.body,
12844
- headers: requestOptions.headers,
12845
- redirect: requestOptions.redirect
12846
- }, requestOptions.request)).then(async (response) => {
12867
+ return fetch(requestOptions.url, Object.assign(
12868
+ {
12869
+ method: requestOptions.method,
12870
+ body: requestOptions.body,
12871
+ headers: requestOptions.headers,
12872
+ redirect: requestOptions.redirect
12873
+ },
12874
+ requestOptions.request
12875
+ )).then(async (response) => {
12847
12876
  url = response.url;
12848
12877
  status = response.status;
12849
12878
  for (const keyAndValue of response.headers) {
@@ -14096,7 +14125,9 @@ var require_dist_node25 = __commonJS({
14096
14125
  case "app":
14097
14126
  return getAppAuthentication(state);
14098
14127
  case "oauth":
14099
- state.log.warn(new deprecation.Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`));
14128
+ state.log.warn(
14129
+ new deprecation.Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`)
14130
+ );
14100
14131
  case "oauth-app":
14101
14132
  return state.oauthApp({
14102
14133
  type: "oauth-app"
@@ -14169,7 +14200,11 @@ var require_dist_node25 = __commonJS({
14169
14200
  const {
14170
14201
  token,
14171
14202
  createdAt
14172
- } = await getInstallationAuthentication(state, {}, request2);
14203
+ } = await getInstallationAuthentication(
14204
+ state,
14205
+ {},
14206
+ request2
14207
+ );
14173
14208
  endpoint.headers.authorization = `token ${token}`;
14174
14209
  return sendRequestWithRetries(state, request2, endpoint, createdAt);
14175
14210
  }
@@ -14690,6 +14725,8 @@ function baseUrlFromDomain(domain) {
14690
14725
  }
14691
14726
 
14692
14727
  // src/lambdas/status/index.ts
14728
+ var cfn = new AWS2.CloudFormation();
14729
+ var ecr = new AWS2.ECR();
14693
14730
  var sf = new AWS2.StepFunctions();
14694
14731
  function secretArnToUrl(arn) {
14695
14732
  const parts = arn.split(":");
@@ -14709,8 +14746,36 @@ function stepFunctionArnToUrl(arn) {
14709
14746
  const region = parts[3];
14710
14747
  return `https://${region}.console.aws.amazon.com/states/home?region=${region}#/statemachines/view/${arn}`;
14711
14748
  }
14749
+ async function generateProvidersStatus(stack, logicalId) {
14750
+ var _a;
14751
+ const resource = await cfn.describeStackResource({ StackName: stack, LogicalResourceId: logicalId }).promise();
14752
+ const providers = JSON.parse(((_a = resource.StackResourceDetail) == null ? void 0 : _a.Metadata) ?? "{}").providers;
14753
+ if (!providers) {
14754
+ return {};
14755
+ }
14756
+ return Promise.all(providers.map(async (p) => {
14757
+ var _a2, _b, _c;
14758
+ if ((_b = (_a2 = p.image) == null ? void 0 : _a2.imageRepository) == null ? void 0 : _b.match(/[0-9]+\.dkr\.ecr\.[a-z0-9\-]+\.amazonaws\.com\/.+/)) {
14759
+ const tags = await ecr.describeImages({
14760
+ repositoryName: p.image.imageRepository.split("/")[1],
14761
+ filter: {
14762
+ tagStatus: "TAGGED"
14763
+ },
14764
+ maxResults: 1
14765
+ }).promise();
14766
+ if (tags.imageDetails && ((_c = tags.imageDetails) == null ? void 0 : _c.length) >= 1) {
14767
+ p.image.latestImage = {
14768
+ tags: tags.imageDetails[0].imageTags,
14769
+ digest: tags.imageDetails[0].imageDigest,
14770
+ date: tags.imageDetails[0].imagePushedAt
14771
+ };
14772
+ }
14773
+ }
14774
+ return p;
14775
+ }));
14776
+ }
14712
14777
  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.PROVIDERS || !process.env.WEBHOOK_HANDLER_ARN || !process.env.STEP_FUNCTION_ARN || !process.env.SETUP_SECRET_ARN || !process.env.SETUP_FUNCTION_URL) {
14778
+ 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
14779
  throw new Error("Missing environment variables");
14715
14780
  }
14716
14781
  const status = {
@@ -14743,7 +14808,7 @@ exports.handler = async function() {
14743
14808
  personalAuthToken: ""
14744
14809
  }
14745
14810
  },
14746
- providers: JSON.parse(process.env.PROVIDERS),
14811
+ providers: await generateProvidersStatus(process.env.STACK_NAME, process.env.LOGICAL_ID),
14747
14812
  troubleshooting: {
14748
14813
  webhookHandlerArn: process.env.WEBHOOK_HANDLER_ARN,
14749
14814
  webhookHandlerUrl: lambdaArnToUrl(process.env.WEBHOOK_HANDLER_ARN),
@@ -14844,7 +14909,7 @@ exports.handler = async function() {
14844
14909
  for (const installation of installations) {
14845
14910
  let installationDetails = {
14846
14911
  id: installation.id,
14847
- url: `https://${githubSecrets.domain}/settings/installations/${installation.id}`,
14912
+ url: installation.html_url,
14848
14913
  status: "Unable to query",
14849
14914
  repositories: []
14850
14915
  };