@cloudsnorkel/cdk-github-runners 0.10.4 → 0.10.5
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 -1
- package/.jsii +66 -27
- package/API.md +42 -7
- package/SETUP_GITHUB.md +16 -12
- package/TESTING.md +61 -0
- package/assets/{delete-runner.lambda → delete-failed-runner.lambda}/index.js +2031 -518
- package/assets/idle-runner-repear.lambda/index.js +2052 -522
- package/assets/image-builders/aws-image-builder/versioner.lambda/index.js +1 -1
- package/assets/setup.lambda/index.html +1 -1
- package/assets/setup.lambda/index.js +577 -159
- package/assets/status.lambda/index.js +1652 -473
- package/assets/token-retriever.lambda/index.js +2025 -521
- package/lib/access.d.ts +4 -2
- package/lib/access.js +7 -5
- package/lib/delete-failed-runner-function.d.ts +13 -0
- package/lib/delete-failed-runner-function.js +23 -0
- package/lib/delete-failed-runner.lambda.js +51 -0
- package/lib/idle-runner-repear.lambda.js +43 -10
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/builder.js +1 -1
- 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/codebuild-deprecated.js +1 -1
- package/lib/image-builders/components.js +1 -1
- package/lib/image-builders/static.js +1 -1
- package/lib/lambda-github.d.ts +8 -4
- package/lib/lambda-github.js +23 -2
- package/lib/lambda-helpers.d.ts +5 -1
- package/lib/lambda-helpers.js +1 -1
- package/lib/providers/codebuild.js +2 -2
- package/lib/providers/common.d.ts +2 -0
- package/lib/providers/common.js +4 -4
- package/lib/providers/ec2.js +2 -2
- package/lib/providers/ecs.js +1 -1
- package/lib/providers/fargate.js +2 -2
- package/lib/providers/lambda.js +2 -2
- package/lib/runner.d.ts +1 -1
- package/lib/runner.js +26 -25
- package/lib/secrets.d.ts +2 -2
- package/lib/secrets.js +2 -2
- package/lib/setup.lambda.js +2 -2
- package/lib/status.lambda.js +4 -4
- package/lib/token-retriever.lambda.js +2 -2
- package/lib/webhook.js +2 -2
- package/package.json +14 -14
- package/lib/delete-runner-function.d.ts +0 -13
- package/lib/delete-runner-function.js +0 -23
- package/lib/delete-runner.lambda.js +0 -41
- /package/lib/{delete-runner.lambda.d.ts → delete-failed-runner.lambda.d.ts} +0 -0
|
@@ -188,7 +188,7 @@ var require_semver = __commonJS({
|
|
|
188
188
|
version = version.version;
|
|
189
189
|
}
|
|
190
190
|
} else if (typeof version !== "string") {
|
|
191
|
-
throw new TypeError(`Invalid
|
|
191
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
192
192
|
}
|
|
193
193
|
if (version.length > MAX_LENGTH) {
|
|
194
194
|
throw new TypeError(
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
and without any path. It should look something like <code>github.mycompany.com</code>.`,p=b(),a=r("input"),s(a,"class","form-control"),s(n,"class","px-3 py-3")},m(u,h){T(u,t,h),T(u,o,h),T(u,n,h),i(n,l),i(n,p),i(n,a),q(a,e[1]),c||(g=M(a,"input",e[15]),c=!0)},p(u,h){h&2&&a.value!==u[1]&&q(a,u[1])},d(u){u&&C(t),u&&C(o),u&&C(n),c=!1,g()}}}function Ie(e){let t,o,n,l,p,a,c,g,u,h,v,f,S,k,A,E,_,m,w,I,O,H;return I=ye(e[13][1]),{c(){t=r("h3"),t.textContent="Authentication Type",o=b(),n=r("div"),l=r("p"),l.textContent=`You can choose between creating a new app that will provide authentication for specific
|
|
10
10
|
repositories, or a personal access token that will provide access to all repositories
|
|
11
11
|
available to you. Apps are easier to set up and provide more fine-grained access control. If
|
|
12
|
-
you have previously created an app, you can choose to use an existing app.`,p=b(),a=r("div"),c=r("input"),g=b(),u=r("label"),u.innerHTML="New GitHub App <b>(recommended)</b>",h=b(),v=r("div"),f=r("input"),S=b(),k=r("label"),k.textContent="Existing GitHub App",A=b(),E=r("div"),_=r("input"),m=b(),w=r("label"),w.textContent="Personal
|
|
12
|
+
you have previously created an app, you can choose to use an existing app.`,p=b(),a=r("div"),c=r("input"),g=b(),u=r("label"),u.innerHTML="New GitHub App <b>(recommended)</b>",h=b(),v=r("div"),f=r("input"),S=b(),k=r("label"),k.textContent="Existing GitHub App",A=b(),E=r("div"),_=r("input"),m=b(),w=r("label"),w.textContent="Personal Access Token",s(c,"class","form-check-input"),s(c,"type","radio"),c.__value="newApp",c.value=c.__value,s(c,"id","newApp"),s(u,"class","form-check-label"),s(u,"for","newApp"),s(a,"class","form-check"),s(f,"class","form-check-input"),s(f,"type","radio"),f.__value="existingApp",f.value=f.__value,s(f,"id","existingApp"),s(k,"class","form-check-label"),s(k,"for","existingApp"),s(v,"class","form-check"),s(_,"class","form-check-input"),s(_,"type","radio"),_.__value="pat",_.value=_.__value,s(_,"id","pat"),s(w,"class","form-check-label"),s(w,"for","pat"),s(E,"class","form-check"),s(n,"class","px-3 py-3"),I.p(c,f,_)},m(d,N){T(d,t,N),T(d,o,N),T(d,n,N),i(n,l),i(n,p),i(n,a),i(a,c),c.checked=c.__value===e[2],i(a,g),i(a,u),i(n,h),i(n,v),i(v,f),f.checked=f.__value===e[2],i(v,S),i(v,k),i(n,A),i(n,E),i(E,_),_.checked=_.__value===e[2],i(E,m),i(E,w),O||(H=[M(c,"change",e[16]),M(f,"change",e[17]),M(_,"change",e[18])],O=!0)},p(d,N){N&4&&(c.checked=c.__value===d[2]),N&4&&(f.checked=f.__value===d[2]),N&4&&(_.checked=_.__value===d[2])},d(d){d&&C(t),d&&C(o),d&&C(n),I.r(),O=!1,W(H)}}}function it(e){let t,o,n,l,p,a,c,g,u,h,v,f,S,k,A,E,_;return{c(){t=r("h2"),t.textContent="Personal Access Token",o=b(),n=r("div"),l=r("p"),p=G("The "),a=r("a"),c=G("personal access token"),u=G(" must have the "),h=r("code"),h.textContent="repo",v=G(`
|
|
13
13
|
scope enabled. Don't forget to also create a webhook as described in `),f=r("a"),f.textContent="SETUP_GITHUB.md",S=G("."),k=b(),A=r("input"),s(a,"href",g="https://"+e[1]+"/settings/tokens"),s(f,"href","https://github.com/CloudSnorkel/cdk-github-runners/blob/main/SETUP_GITHUB.md"),s(A,"class","form-control"),s(A,"placeholder","Token e.g. ghp_abcdefghijklmnopqrstuvwxyz1234567890"),s(n,"class","px-3 py-3")},m(m,w){T(m,t,w),T(m,o,w),T(m,n,w),i(n,l),i(l,p),i(l,a),i(a,c),i(l,u),i(l,h),i(l,v),i(l,f),i(l,S),i(n,k),i(n,A),q(A,e[7]),E||(_=M(A,"input",e[25]),E=!0)},p(m,w){w&2&&g!==(g="https://"+m[1]+"/settings/tokens")&&s(a,"href",g),w&128&&A.value!==m[7]&&q(A,m[7])},d(m){m&&C(t),m&&C(o),m&&C(n),E=!1,_()}}}function ot(e){let t,o,n,l,p,a,c,g,u,h,v,f,S,k,A,E,_,m;return{c(){t=r("h3"),t.textContent="Existing App Details",o=b(),n=r("div"),l=r("p"),l.innerHTML=`Existing apps must have <code>actions</code> and <code>administration</code> write
|
|
14
14
|
permissions. Don't forget to set up the webhook and its secret as described in <a href="https://github.com/CloudSnorkel/cdk-github-runners/blob/main/SETUP_GITHUB.md">SETUP_GITHUB.md</a>.`,p=b(),a=r("div"),c=r("label"),c.textContent="App Id",g=b(),u=r("div"),h=r("input"),v=b(),f=r("div"),S=r("label"),S.textContent="Private Key",k=b(),A=r("div"),E=r("textarea"),s(c,"for","appid"),s(c,"class","col-sm-2 col-form-label"),s(h,"type","number"),s(h,"class","form-control"),s(h,"id","appid"),s(u,"class","col-sm-10"),s(a,"class","form-group row px-3 py-2"),s(S,"for","pk"),s(S,"class","col-sm-2 col-form-label"),s(E,"class","form-control"),s(E,"id","pk"),s(E,"rows","10"),s(A,"class","col-sm-10"),s(f,"class","form-group row px-3 py-2"),s(n,"class","px-3 py-3")},m(w,I){T(w,t,I),T(w,o,I),T(w,n,I),i(n,l),i(n,p),i(n,a),i(a,c),i(a,g),i(a,u),i(u,h),q(h,e[5]),i(n,v),i(n,f),i(f,S),i(f,k),i(f,A),i(A,E),q(E,e[6]),_||(m=[M(h,"input",e[23]),M(E,"input",e[24])],_=!0)},p(w,I){I&32&&ze(h.value)!==w[5]&&q(h,w[5]),I&64&&q(E,w[6])},d(w){w&&C(t),w&&C(o),w&&C(n),_=!1,W(m)}}}function st(e){let t,o,n,l,p,a,c,g,u,h,v,f,S,k,A,E,_,m,w,I,O=e[0]==="ghes"&&Ge(e),H=e[3]==="org"&&Re(e);return m=ye(e[13][0]),{c(){t=r("h3"),t.textContent="New App Settings",o=b(),n=r("div"),l=r("p"),l.textContent=`Choose whether to create a new personal app or organization app. A private personal app can
|
|
15
15
|
only be used for repositories under your user. A private origination app can only be used
|