@cloudsnorkel/cdk-github-runners 0.5.6 → 0.5.8
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 +4 -4
- package/README.md +6 -3
- package/lib/lambdas/setup/index.html +11 -11
- package/lib/lambdas/setup/index.js +1 -1
- package/lib/lambdas/update-lambda/index.js +2561 -602
- package/lib/providers/codebuild.js +1 -1
- package/lib/providers/common.js +3 -3
- package/lib/providers/docker-images/codebuild/linux-arm64/Dockerfile +1 -0
- package/lib/providers/docker-images/codebuild/linux-x64/Dockerfile +1 -0
- package/lib/providers/docker-images/fargate/linux-arm64/Dockerfile +1 -0
- package/lib/providers/docker-images/fargate/linux-x64/Dockerfile +1 -0
- package/lib/providers/docker-images/lambda/linux-arm64/runner.sh +2 -0
- package/lib/providers/docker-images/lambda/linux-x64/runner.sh +2 -0
- package/lib/providers/fargate.js +1 -1
- package/lib/providers/image-builders/codebuild.js +1 -1
- package/lib/providers/image-builders/container.js +2 -2
- package/lib/providers/image-builders/static.js +1 -1
- package/lib/providers/lambda.js +1 -1
- package/lib/runner.js +1 -1
- package/lib/secrets.js +1 -1
- package/package.json +10 -12
- package/setup/src/App.svelte +1 -1
package/.jsii
CHANGED
|
@@ -3010,7 +3010,7 @@
|
|
|
3010
3010
|
"stability": "experimental"
|
|
3011
3011
|
},
|
|
3012
3012
|
"homepage": "https://github.com/CloudSnorkel/cdk-github-runners.git",
|
|
3013
|
-
"jsiiVersion": "1.
|
|
3013
|
+
"jsiiVersion": "1.71.0 (build f1f58ae)",
|
|
3014
3014
|
"keywords": [
|
|
3015
3015
|
"aws",
|
|
3016
3016
|
"aws-cdk",
|
|
@@ -3034,7 +3034,7 @@
|
|
|
3034
3034
|
},
|
|
3035
3035
|
"name": "@cloudsnorkel/cdk-github-runners",
|
|
3036
3036
|
"readme": {
|
|
3037
|
-
"markdown": "# GitHub Self-Hosted Runners CDK Constructs\n\n[][7]\n[][6]\n[][8]\n[][11]\n[][12]\n[](https://github.com/CloudSnorkel/cdk-github-runners/actions/workflows/release.yml)\n[](https://github.com/CloudSnorkel/cdk-github-runners/blob/main/LICENSE)\n\nUse this CDK construct to create ephemeral [self-hosted GitHub runners][1] on-demand inside your AWS account.\n\n* Easy to configure GitHub integration with a web-based interface\n* Customizable runners with decent defaults\n* Multiple runner configurations controlled by labels\n* Everything fully hosted in your account\n* Automatically updated build environment with latest runner version\n\nSelf-hosted runners in AWS are useful when:\n\n* You need easy access to internal resources in your actions\n* You want to pre-install some software for your actions\n* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials][2] has more security controls)\n\nEphemeral (or on-demand) runners are the [recommended way by GitHub][14] for auto-scaling, and they make sure all jobs run with a clean image. Runners are started on-demand. You don't pay unless a job is running.\n\n## API\n\nThe best way to browse API documentation is on [Constructs Hub][13]. It is available in all supported programming languages.\n\n## Providers\n\nA runner provider creates compute resources on-demand and uses [actions/runner][5] to start a runner.\n\n| | CodeBuild | Fargate | Lambda |\n|------------------|----------------------------|----------------|---------------|\n| **Time limit** | 8 hours | Unlimited | 15 minutes |\n| **vCPUs** | 2, 4, 8, or 72 | 0.25 to 4 | 1 to 6 |\n| **RAM** | 3gb, 7gb, 15gb, or 145gb | 512mb to 30gb | 128mb to 10gb |\n| **Storage** | 50gb to 824gb | 20gb to 200gb | Up to 10gb |\n| **Architecture** | x86_64, ARM64 | x86_64, ARM64 | x86_64, ARM64 |\n| **sudo** | ✔ | ✔ | ❌ |\n| **Docker** | ✔ (Linux only) | ❌ | ❌ |\n| **Spot pricing** | ❌ | ✔ | ❌ |\n| **OS** | Linux, Windows | Linux, Windows | Linux |\n\nThe best provider to use mostly depends on your current infrastructure. When in doubt, CodeBuild is always a good choice. Execution history and logs are easy to view, and it has no restrictive limits unless you need to run for more than 8 hours.\n\nYou can also create your own provider by implementing `IRunnerProvider`.\n\n## Installation\n\n1. Confirm you're using CDK v2\n2. Install the appropriate package\n 1. [Python][6]\n ```\n pip install cloudsnorkel.cdk-github-runners\n ```\n 2. [TypeScript or JavaScript][7]\n ```\n npm i @cloudsnorkel/cdk-github-runners\n ```\n 3. [Java][8]\n ```xml\n <dependency>\n <groupId>com.cloudsnorkel</groupId>\n <artifactId>cdk.github.runners</artifactId>\n </dependency>\n ```\n 4. [Go][11]\n ```\n go get github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n ```\n 5. [.NET][12]\n ```\n dotnet add package CloudSnorkel.Cdk.Github.Runners\n ```\n3. Use `GitHubRunners` construct in your code (starting with default arguments is fine)\n4. Deploy your stack\n5. Look for the status command output similar to `aws --region us-east-1 lambda invoke --function-name status-XYZ123 status.json`\n6. Execute the status command (you may need to specify `--profile` too) and open the resulting `status.json` file\n7. Open the URL in `github.setup.url` from `status.json` or [manually setup GitHub](SETUP_GITHUB.md) integration as an app or with personal access token\n8. Run status command again to confirm `github.auth.status` and `github.webhook.status` are OK\n9. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted, linux, codebuild]` or similar\n10. If the action is not successful, see [troubleshooting](#Troubleshooting)\n\n[](https://youtu.be/wlyv_3V8lIw)\n\n## Customizing\n\nThe default providers configured by `GitHubRunners` are useful for testing but probably not too much for actual production work. They run in the default VPC or no VPC and have no added IAM permissions. You would usually want to configure the providers yourself.\n\nFor example:\n\n```typescript\nlet vpc: ec2.Vpc;\nlet runnerSg: ec2.SecurityGroup;\nlet dbSg: ec2.SecurityGroup;\nlet bucket: s3.Bucket;\n\n// create a custom CodeBuild provider\nconst myProvider = new CodeBuildRunner(this, 'codebuild runner', {\n label: 'my-codebuild',\n vpc: vpc,\n securityGroup: runnerSg,\n});\n// grant some permissions to the provider\nbucket.grantReadWrite(myProvider);\ndbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), 'allow runners to connect to MySQL database');\n\n// create the runner infrastructure\nnew GitHubRunners(this, 'runners', {\n providers: [myProvider],\n});\n```\n\nAnother way to customize runners is by modifying the image used to spin them up. The image contains the [runner][5], any required dependencies, and integration code with the provider. You may choose to customize this image by adding more packages, for example.\n\n```typescript\nconst myBuilder = new CodeBuildImageBuilder(this, 'image builder', {\n dockerfilePath: FargateRunner.LINUX_X64_DOCKERFILE_PATH,\n runnerVersion: RunnerVersion.specific('2.291.0'),\n rebuildInterval: Duration.days(14),\n});\nmyBuilder.setBuildArg('EXTRA_PACKAGES', 'nginx xz-utils');\n\nconst myProvider = new FargateRunner(this, 'fargate runner', {\n label: 'customized-fargate',\n vpc: vpc,\n securityGroup: runnerSg,\n imageBuilder: myBuilder,\n});\n\n// create the runner infrastructure\nnew GitHubRunners(stack, 'runners', {\n providers: [myProvider],\n});\n```\n\nYour workflow will then look like:\n\n```yaml\nname: self-hosted example\non: push\njobs:\n self-hosted:\n runs-on: [self-hosted, customized-fargate]\n steps:\n - run: echo hello world\n```\n\nWindows images must be built with AWS Image Builder.\n\n```typescript\nconst myWindowsBuilder = new ContainerImageBuilder(this, 'Windows image builder', {\n architecture: Architecture.X86_64,\n os: Os.WINDOWS,\n runnerVersion: RunnerVersion.specific('2.291.0'),\n rebuildInterval: Duration.days(14),\n});\nmyWindowsBuilder.addComponent(new ImageBuilderComponent(this, 'Ninja Component',\n {\n displayName: 'Ninja',\n description: 'Download and install Ninja build system',\n platform: 'Windows',\n commands: [\n 'Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip\" -OutFile ninja.zip',\n 'Expand-Archive ninja.zip -DestinationPath C:\\\\actions',\n 'del ninja.zip',\n ],\n }\n));\n\nconst myProvider = new FargateRunner(this, 'fargate runner', {\n label: 'customized-windows-fargate',\n vpc: vpc,\n securityGroup: runnerSg,\n imageBuiler: myWindowsBuilder,\n});\n\n// create the runner infrastructure\nnew GitHubRunners(stack, 'runners', {\n providers: [myProvider],\n});\n```\n\n## Architecture\n\n\n\n## Troubleshooting\n\n1. Always start with the status function, make sure no errors are reported, and confirm all status codes are OK\n2. Confirm the webhook Lambda was called by visiting the URL in `troubleshooting.webhookHandlerUrl` from `status.json`\n 1. If it's not called or logs errors, confirm the webhook settings on the GitHub side\n 2. If you see too many errors, make sure you're only sending `workflow_job` events\n3. When using GitHub app, make sure there are active installation in `github.auth.app.installations`\n4. Check execution details of the orchestrator step function by visiting the URL in `troubleshooting.stepFunctionUrl` from `status.json`\n 1. Use the details tab to find the specific execution of the provider (Lambda, CodeBuild, Fargate, etc.)\n 2. Every step function execution should be successful, even if the runner action inside it failed\n\n## Other Options\n\n1. [philips-labs/terraform-aws-github-runner][3] if you're using Terraform\n2. [actions-runner-controller/actions-runner-controller][4] if you're using Kubernetes\n\n\n[1]: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners\n[2]: https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions\n[3]: https://github.com/philips-labs/terraform-aws-github-runner\n[4]: https://github.com/actions-runner-controller/actions-runner-controller\n[5]: https://github.com/actions/runner\n[6]: https://pypi.org/project/cloudsnorkel.cdk-github-runners\n[7]: https://www.npmjs.com/package/@cloudsnorkel/cdk-github-runners\n[8]: https://search.maven.org/search?q=g:%22com.cloudsnorkel%22%20AND%20a:%22cdk.github.runners%22\n[9]: https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps\n[10]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n[11]: https://pkg.go.dev/github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n[12]: https://www.nuget.org/packages/CloudSnorkel.Cdk.Github.Runners/\n[13]: https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/\n[14]: https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling\n"
|
|
3037
|
+
"markdown": "# GitHub Self-Hosted Runners CDK Constructs\n\n[][7]\n[][6]\n[][8]\n[][11]\n[][12]\n[](https://github.com/CloudSnorkel/cdk-github-runners/actions/workflows/release.yml)\n[](https://github.com/CloudSnorkel/cdk-github-runners/blob/main/LICENSE)\n\nUse this CDK construct to create ephemeral [self-hosted GitHub runners][1] on-demand inside your AWS account.\n\n* Easy to configure GitHub integration with a web-based interface\n* Customizable runners with decent defaults\n* Multiple runner configurations controlled by labels\n* Everything fully hosted in your account\n* Automatically updated build environment with latest runner version\n\nSelf-hosted runners in AWS are useful when:\n\n* You need easy access to internal resources in your actions\n* You want to pre-install some software for your actions\n* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials][2] has more security controls)\n\nEphemeral (or on-demand) runners are the [recommended way by GitHub][14] for auto-scaling, and they make sure all jobs run with a clean image. Runners are started on-demand. You don't pay unless a job is running.\n\n## API\n\nThe best way to browse API documentation is on [Constructs Hub][13]. It is available in all supported programming languages.\n\n## Providers\n\nA runner provider creates compute resources on-demand and uses [actions/runner][5] to start a runner.\n\n| | CodeBuild | Fargate | Lambda |\n|------------------|----------------------------|----------------|---------------|\n| **Time limit** | 8 hours | Unlimited | 15 minutes |\n| **vCPUs** | 2, 4, 8, or 72 | 0.25 to 4 | 1 to 6 |\n| **RAM** | 3gb, 7gb, 15gb, or 145gb | 512mb to 30gb | 128mb to 10gb |\n| **Storage** | 50gb to 824gb | 20gb to 200gb | Up to 10gb |\n| **Architecture** | x86_64, ARM64 | x86_64, ARM64 | x86_64, ARM64 |\n| **sudo** | ✔ | ✔ | ❌ |\n| **Docker** | ✔ (Linux only) | ❌ | ❌ |\n| **Spot pricing** | ❌ | ✔ | ❌ |\n| **OS** | Linux, Windows | Linux, Windows | Linux |\n\nThe best provider to use mostly depends on your current infrastructure. When in doubt, CodeBuild is always a good choice. Execution history and logs are easy to view, and it has no restrictive limits unless you need to run for more than 8 hours.\n\nYou can also create your own provider by implementing `IRunnerProvider`.\n\n## Installation\n\n1. Confirm you're using CDK v2\n2. Install the appropriate package\n 1. [Python][6]\n ```\n pip install cloudsnorkel.cdk-github-runners\n ```\n 2. [TypeScript or JavaScript][7]\n ```\n npm i @cloudsnorkel/cdk-github-runners\n ```\n 3. [Java][8]\n ```xml\n <dependency>\n <groupId>com.cloudsnorkel</groupId>\n <artifactId>cdk.github.runners</artifactId>\n </dependency>\n ```\n 4. [Go][11]\n ```\n go get github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n ```\n 5. [.NET][12]\n ```\n dotnet add package CloudSnorkel.Cdk.Github.Runners\n ```\n3. Use `GitHubRunners` construct in your code (starting with default arguments is fine)\n4. Deploy your stack\n5. Look for the status command output similar to `aws --region us-east-1 lambda invoke --function-name status-XYZ123 status.json`\n6. Execute the status command (you may need to specify `--profile` too) and open the resulting `status.json` file\n7. Open the URL in `github.setup.url` from `status.json` or [manually setup GitHub](SETUP_GITHUB.md) integration as an app or with personal access token\n8. Run status command again to confirm `github.auth.status` and `github.webhook.status` are OK\n9. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted, linux, codebuild]` or similar\n10. If the action is not successful, see [troubleshooting](#Troubleshooting)\n\n[](https://youtu.be/wlyv_3V8lIw)\n\n## Customizing\n\nThe default providers configured by `GitHubRunners` are useful for testing but probably not too much for actual production work. They run in the default VPC or no VPC and have no added IAM permissions. You would usually want to configure the providers yourself.\n\nFor example:\n\n```typescript\nlet vpc: ec2.Vpc;\nlet runnerSg: ec2.SecurityGroup;\nlet dbSg: ec2.SecurityGroup;\nlet bucket: s3.Bucket;\n\n// create a custom CodeBuild provider\nconst myProvider = new CodeBuildRunner(this, 'codebuild runner', {\n label: 'my-codebuild',\n vpc: vpc,\n securityGroup: runnerSg,\n});\n// grant some permissions to the provider\nbucket.grantReadWrite(myProvider);\ndbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), 'allow runners to connect to MySQL database');\n\n// create the runner infrastructure\nnew GitHubRunners(this, 'runners', {\n providers: [myProvider],\n});\n```\n\nAnother way to customize runners is by modifying the image used to spin them up. The image contains the [runner][5], any required dependencies, and integration code with the provider. You may choose to customize this image by adding more packages, for example.\n\n```typescript\nconst myBuilder = new CodeBuildImageBuilder(this, 'image builder', {\n dockerfilePath: FargateRunner.LINUX_X64_DOCKERFILE_PATH,\n runnerVersion: RunnerVersion.specific('2.291.0'),\n rebuildInterval: Duration.days(14),\n});\nmyBuilder.setBuildArg('EXTRA_PACKAGES', 'nginx xz-utils');\n\nconst myProvider = new FargateRunner(this, 'fargate runner', {\n label: 'customized-fargate',\n vpc: vpc,\n securityGroup: runnerSg,\n imageBuilder: myBuilder,\n});\n\n// create the runner infrastructure\nnew GitHubRunners(stack, 'runners', {\n providers: [myProvider],\n});\n```\n\nYour workflow will then look like:\n\n```yaml\nname: self-hosted example\non: push\njobs:\n self-hosted:\n runs-on: [self-hosted, customized-fargate]\n steps:\n - run: echo hello world\n```\n\nWindows images must be built with AWS Image Builder.\n\n```typescript\nconst myWindowsBuilder = new ContainerImageBuilder(this, 'Windows image builder', {\n architecture: Architecture.X86_64,\n os: Os.WINDOWS,\n runnerVersion: RunnerVersion.specific('2.291.0'),\n rebuildInterval: Duration.days(14),\n});\nmyWindowsBuilder.addComponent(new ImageBuilderComponent(this, 'Ninja Component',\n {\n displayName: 'Ninja',\n description: 'Download and install Ninja build system',\n platform: 'Windows',\n commands: [\n 'Invoke-WebRequest -UseBasicParsing -Uri \"https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip\" -OutFile ninja.zip',\n 'Expand-Archive ninja.zip -DestinationPath C:\\\\actions',\n 'del ninja.zip',\n ],\n }\n));\n\nconst myProvider = new FargateRunner(this, 'fargate runner', {\n label: 'customized-windows-fargate',\n vpc: vpc,\n securityGroup: runnerSg,\n imageBuiler: myWindowsBuilder,\n});\n\n// create the runner infrastructure\nnew GitHubRunners(stack, 'runners', {\n providers: [myProvider],\n});\n```\n\n## Architecture\n\n\n\n## Troubleshooting\n\n1. Always start with the status function, make sure no errors are reported, and confirm all status codes are OK\n2. If jobs are stuck on pending:\n 1. Make sure `runs-on` in the workflow matches the expected labels set in the runner provider\n 2. If it happens every time, cancel the job and start it again\n4. Confirm the webhook Lambda was called by visiting the URL in `troubleshooting.webhookHandlerUrl` from `status.json`\n 1. If it's not called or logs errors, confirm the webhook settings on the GitHub side\n 2. If you see too many errors, make sure you're only sending `workflow_job` events\n5. When using GitHub app, make sure there are active installation in `github.auth.app.installations`\n6. Check execution details of the orchestrator step function by visiting the URL in `troubleshooting.stepFunctionUrl` from `status.json`\n 1. Use the details tab to find the specific execution of the provider (Lambda, CodeBuild, Fargate, etc.)\n 2. Every step function execution should be successful, even if the runner action inside it failed\n\n## Other Options\n\n1. [philips-labs/terraform-aws-github-runner][3] if you're using Terraform\n2. [actions-runner-controller/actions-runner-controller][4] if you're using Kubernetes\n\n\n[1]: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners\n[2]: https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions\n[3]: https://github.com/philips-labs/terraform-aws-github-runner\n[4]: https://github.com/actions-runner-controller/actions-runner-controller\n[5]: https://github.com/actions/runner\n[6]: https://pypi.org/project/cloudsnorkel.cdk-github-runners\n[7]: https://www.npmjs.com/package/@cloudsnorkel/cdk-github-runners\n[8]: https://search.maven.org/search?q=g:%22com.cloudsnorkel%22%20AND%20a:%22cdk.github.runners%22\n[9]: https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps\n[10]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n[11]: https://pkg.go.dev/github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners\n[12]: https://www.nuget.org/packages/CloudSnorkel.Cdk.Github.Runners/\n[13]: https://constructs.dev/packages/@cloudsnorkel/cdk-github-runners/\n[14]: https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling\n"
|
|
3038
3038
|
},
|
|
3039
3039
|
"repository": {
|
|
3040
3040
|
"type": "git",
|
|
@@ -7148,6 +7148,6 @@
|
|
|
7148
7148
|
"symbolId": "src/providers/image-builders/static:StaticRunnerImage"
|
|
7149
7149
|
}
|
|
7150
7150
|
},
|
|
7151
|
-
"version": "0.5.
|
|
7152
|
-
"fingerprint": "
|
|
7151
|
+
"version": "0.5.8",
|
|
7152
|
+
"fingerprint": "9g625LlWvr/UjoNx7sCCLJUs/y7tbxsmxMqXBrgyOY8="
|
|
7153
7153
|
}
|
package/README.md
CHANGED
|
@@ -191,11 +191,14 @@ new GitHubRunners(stack, 'runners', {
|
|
|
191
191
|
## Troubleshooting
|
|
192
192
|
|
|
193
193
|
1. Always start with the status function, make sure no errors are reported, and confirm all status codes are OK
|
|
194
|
-
2.
|
|
194
|
+
2. If jobs are stuck on pending:
|
|
195
|
+
1. Make sure `runs-on` in the workflow matches the expected labels set in the runner provider
|
|
196
|
+
2. If it happens every time, cancel the job and start it again
|
|
197
|
+
4. Confirm the webhook Lambda was called by visiting the URL in `troubleshooting.webhookHandlerUrl` from `status.json`
|
|
195
198
|
1. If it's not called or logs errors, confirm the webhook settings on the GitHub side
|
|
196
199
|
2. If you see too many errors, make sure you're only sending `workflow_job` events
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
5. When using GitHub app, make sure there are active installation in `github.auth.app.installations`
|
|
201
|
+
6. Check execution details of the orchestrator step function by visiting the URL in `troubleshooting.stepFunctionUrl` from `status.json`
|
|
199
202
|
1. Use the details tab to find the specific execution of the provider (Lambda, CodeBuild, Fargate, etc.)
|
|
200
203
|
2. Every step function execution should be successful, even if the runner action inside it failed
|
|
201
204
|
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Setup GitHub Runners</title>
|
|
7
7
|
<script type="module" crossorigin>
|
|
8
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const
|
|
9
|
-
and without any path. It should look something like <code>github.mycompany.com</code>.`,
|
|
8
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const p of n)if(p.type==="childList")for(const c of p.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function o(n){const p={};return n.integrity&&(p.integrity=n.integrity),n.referrerpolicy&&(p.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?p.credentials="include":n.crossorigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function i(n){if(n.ep)return;n.ep=!0;const p=o(n);fetch(n.href,p)}})();function Y(){}function Le(e){return e()}function Ce(){return Object.create(null)}function j(e){e.forEach(Le)}function Ue(e){return typeof e=="function"}function Be(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function De(e){return Object.keys(e).length===0}function l(e,t){e.appendChild(t)}function H(e,t,o){e.insertBefore(t,o||null)}function T(e){e.parentNode&&e.parentNode.removeChild(e)}function r(e){return document.createElement(e)}function I(e){return document.createTextNode(e)}function b(){return I(" ")}function Me(){return I("")}function $(e,t,o,i){return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)}function s(e,t,o){o==null?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function $e(e){return e===""?null:+e}function je(e){return Array.from(e.childNodes)}function ce(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function M(e,t){e.value=t==null?"":t}let ke;function ee(e){ke=e}const x=[],Se=[],ae=[],Te=[],qe=Promise.resolve();let be=!1;function Je(){be||(be=!0,qe.then(ze))}function ve(e){ae.push(e)}const he=new Set;let ue=0;function ze(){const e=ke;do{for(;ue<x.length;){const t=x[ue];ue++,ee(t),Ke(t.$$)}for(ee(null),x.length=0,ue=0;Se.length;)Se.pop()();for(let t=0;t<ae.length;t+=1){const o=ae[t];he.has(o)||(he.add(o),o())}ae.length=0}while(x.length);for(;Te.length;)Te.pop()();be=!1,he.clear(),ee(e)}function Ke(e){if(e.fragment!==null){e.update(),j(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ve)}}const We=new Set;function Fe(e,t){e&&e.i&&(We.delete(e),e.i(t))}function Ye(e,t,o,i){const{fragment:n,after_update:p}=e.$$;n&&n.m(t,o),i||ve(()=>{const c=e.$$.on_mount.map(Le).filter(Ue);e.$$.on_destroy?e.$$.on_destroy.push(...c):j(c),e.$$.on_mount=[]}),p.forEach(ve)}function Ze(e,t){const o=e.$$;o.fragment!==null&&(j(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}function Qe(e,t){e.$$.dirty[0]===-1&&(x.push(e),Je(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Ve(e,t,o,i,n,p,c,u=[-1]){const v=ke;ee(e);const a=e.$$={fragment:null,ctx:[],props:p,update:Y,not_equal:n,bound:Ce(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(v?v.$$.context:[])),callbacks:Ce(),dirty:u,skip_bound:!1,root:t.target||v.$$.root};c&&c(a.root);let h=!1;if(a.ctx=o?o(e,t.props||{},(g,f,...O)=>{const k=O.length?O[0]:f;return a.ctx&&n(a.ctx[g],a.ctx[g]=k)&&(!a.skip_bound&&a.bound[g]&&a.bound[g](k),h&&Qe(e,g)),f}):[],a.update(),h=!0,j(a.before_update),a.fragment=i?i(a.ctx):!1,t.target){if(t.hydrate){const g=je(t.target);a.fragment&&a.fragment.l(g),g.forEach(T)}else a.fragment&&a.fragment.c();t.intro&&Fe(e.$$.fragment),Ye(e,t.target,t.anchor,t.customElement),ze()}ee(v)}class Xe{$destroy(){Ze(this,1),this.$destroy=Y}$on(t,o){if(!Ue(o))return Y;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(o),()=>{const n=i.indexOf(o);n!==-1&&i.splice(n,1)}}$set(t){this.$$set&&!De(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Oe(e){let t,o,i,n,p,c,u,v;return{c(){t=r("h3"),t.textContent="GitHub Enterprise Server Domain",o=b(),i=r("div"),n=r("p"),n.innerHTML=`Where is GitHub Enterprise Server hosted? Type in the domain without <code>https://</code>
|
|
9
|
+
and without any path. It should look something like <code>github.mycompany.com</code>.`,p=b(),c=r("input"),s(c,"class","form-control"),s(i,"class","px-3 py-3")},m(a,h){H(a,t,h),H(a,o,h),H(a,i,h),l(i,n),l(i,p),l(i,c),M(c,e[1]),u||(v=$(c,"input",e[15]),u=!0)},p(a,h){h&2&&c.value!==a[1]&&M(c,a[1])},d(a){a&&T(t),a&&T(o),a&&T(i),u=!1,v()}}}function He(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C,d,_,A,E,N;return{c(){t=r("h3"),t.textContent="Authentication Type",o=b(),i=r("div"),n=r("p"),n.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.`,
|
|
13
|
-
scope enabled. Don't forget to also create a webhook as described in `),f=r("a"),f.textContent="SETUP_GITHUB.md",O=I("."),k=b(),S=r("input"),s(
|
|
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>.`,
|
|
12
|
+
you have previously created an app, you can choose to use an existing app.`,p=b(),c=r("div"),u=r("input"),v=b(),a=r("label"),a.innerHTML="New GitHub App <b>(recommended)</b>",h=b(),g=r("div"),f=r("input"),O=b(),k=r("label"),k.textContent="Existing GitHub App",S=b(),C=r("div"),d=r("input"),_=b(),A=r("label"),A.textContent="Personal Authentication Token",s(u,"class","form-check-input"),s(u,"type","radio"),u.__value="newApp",u.value=u.__value,s(u,"id","newApp"),e[13][1].push(u),s(a,"class","form-check-label"),s(a,"for","newApp"),s(c,"class","form-check"),s(f,"class","form-check-input"),s(f,"type","radio"),f.__value="existingApp",f.value=f.__value,s(f,"id","existingApp"),e[13][1].push(f),s(k,"class","form-check-label"),s(k,"for","existingApp"),s(g,"class","form-check"),s(d,"class","form-check-input"),s(d,"type","radio"),d.__value="pat",d.value=d.__value,s(d,"id","pat"),e[13][1].push(d),s(A,"class","form-check-label"),s(A,"for","pat"),s(C,"class","form-check"),s(i,"class","px-3 py-3")},m(m,w){H(m,t,w),H(m,o,w),H(m,i,w),l(i,n),l(i,p),l(i,c),l(c,u),u.checked=u.__value===e[2],l(c,v),l(c,a),l(i,h),l(i,g),l(g,f),f.checked=f.__value===e[2],l(g,O),l(g,k),l(i,S),l(i,C),l(C,d),d.checked=d.__value===e[2],l(C,_),l(C,A),E||(N=[$(u,"change",e[16]),$(f,"change",e[17]),$(d,"change",e[18])],E=!0)},p(m,w){w&4&&(u.checked=u.__value===m[2]),w&4&&(f.checked=f.__value===m[2]),w&4&&(d.checked=d.__value===m[2])},d(m){m&&T(t),m&&T(o),m&&T(i),e[13][1].splice(e[13][1].indexOf(u),1),e[13][1].splice(e[13][1].indexOf(f),1),e[13][1].splice(e[13][1].indexOf(d),1),E=!1,j(N)}}}function xe(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C,d;return{c(){t=r("h2"),t.textContent="Personal Access Token",o=b(),i=r("div"),n=r("p"),p=I("The "),c=r("a"),u=I("personal access token"),a=I(" must have the "),h=r("code"),h.textContent="repo",g=I(`
|
|
13
|
+
scope enabled. Don't forget to also create a webhook as described in `),f=r("a"),f.textContent="SETUP_GITHUB.md",O=I("."),k=b(),S=r("input"),s(c,"href",v="https://"+e[1]+"/settings/tokens"),s(f,"href","https://github.com/CloudSnorkel/cdk-github-runners/blob/main/SETUP_GITHUB.md"),s(S,"class","form-control"),s(S,"placeholder","Token e.g. ghp_abcdefghijklmnopqrstuvwxyz1234567890"),s(i,"class","px-3 py-3")},m(_,A){H(_,t,A),H(_,o,A),H(_,i,A),l(i,n),l(n,p),l(n,c),l(c,u),l(n,a),l(n,h),l(n,g),l(n,f),l(n,O),l(i,k),l(i,S),M(S,e[7]),C||(d=$(S,"input",e[25]),C=!0)},p(_,A){A&2&&v!==(v="https://"+_[1]+"/settings/tokens")&&s(c,"href",v),A&128&&S.value!==_[7]&&M(S,_[7])},d(_){_&&T(t),_&&T(o),_&&T(i),C=!1,d()}}}function et(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C,d,_;return{c(){t=r("h3"),t.textContent="Existing App Details",o=b(),i=r("div"),n=r("p"),n.innerHTML=`Existing apps must have <code>actions</code> and <code>administration</code> write
|
|
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(),c=r("div"),u=r("label"),u.textContent="App Id",v=b(),a=r("div"),h=r("input"),g=b(),f=r("div"),O=r("label"),O.textContent="Private Key",k=b(),S=r("div"),C=r("textarea"),s(u,"for","appid"),s(u,"class","col-sm-2 col-form-label"),s(h,"type","number"),s(h,"class","form-control"),s(h,"id","appid"),s(a,"class","col-sm-10"),s(c,"class","form-group row px-3 py-2"),s(O,"for","pk"),s(O,"class","col-sm-2 col-form-label"),s(C,"class","form-control"),s(C,"id","pk"),s(C,"rows","10"),s(S,"class","col-sm-10"),s(f,"class","form-group row px-3 py-2"),s(i,"class","px-3 py-3")},m(A,E){H(A,t,E),H(A,o,E),H(A,i,E),l(i,n),l(i,p),l(i,c),l(c,u),l(c,v),l(c,a),l(a,h),M(h,e[5]),l(i,g),l(i,f),l(f,O),l(f,k),l(f,S),l(S,C),M(C,e[6]),d||(_=[$(h,"input",e[23]),$(C,"input",e[24])],d=!0)},p(A,E){E&32&&$e(h.value)!==A[5]&&M(h,A[5]),E&64&&M(C,A[6])},d(A){A&&T(t),A&&T(o),A&&T(i),d=!1,j(_)}}}function tt(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C,d,_,A,E=e[0]==="ghes"&&Ne(e),N=e[3]==="org"&&Ie(e);return{c(){t=r("h3"),t.textContent="New App Settings",o=b(),i=r("div"),n=r("p"),n.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
|
|
16
|
-
for repositories under that organization.`,
|
|
17
|
-
you can make the app public.`,o=b(),i=r("div"),n=r("input"),
|
|
18
|
-
`),
|
|
19
|
-
then your organization slug is `),g=r("code"),g.textContent="MyOrg",f=I("."),O=b(),k=r("input"),s(k,"class","form-control"),s(i,"class","px-3 py-3")},m(d,_){H(d,t,_),H(d,o,_),H(d,i,_),l(i,n),l(n,
|
|
16
|
+
for repositories under that organization.`,p=b(),c=r("div"),u=r("input"),v=b(),a=r("label"),a.textContent="User app",h=b(),g=r("div"),f=r("input"),O=b(),k=r("label"),k.textContent="Organization app",S=b(),E&&E.c(),C=b(),N&&N.c(),d=Me(),s(u,"class","form-check-input"),s(u,"type","radio"),u.__value="user",u.value=u.__value,s(u,"id","userScope"),e[13][2].push(u),s(a,"class","form-check-label"),s(a,"for","userScope"),s(c,"class","form-check"),s(f,"class","form-check-input"),s(f,"type","radio"),f.__value="org",f.value=f.__value,s(f,"id","orgScope"),e[13][2].push(f),s(k,"class","form-check-label"),s(k,"for","orgScope"),s(g,"class","form-check"),s(i,"class","px-3 py-3")},m(m,w){H(m,t,w),H(m,o,w),H(m,i,w),l(i,n),l(i,p),l(i,c),l(c,u),u.checked=u.__value===e[3],l(c,v),l(c,a),l(i,h),l(i,g),l(g,f),f.checked=f.__value===e[3],l(g,O),l(g,k),l(i,S),E&&E.m(i,null),H(m,C,w),N&&N.m(m,w),H(m,d,w),_||(A=[$(u,"change",e[19]),$(f,"change",e[20])],_=!0)},p(m,w){w&8&&(u.checked=u.__value===m[3]),w&8&&(f.checked=f.__value===m[3]),m[0]==="ghes"?E?E.p(m,w):(E=Ne(m),E.c(),E.m(i,null)):E&&(E.d(1),E=null),m[3]==="org"?N?N.p(m,w):(N=Ie(m),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null)},d(m){m&&T(t),m&&T(o),m&&T(i),e[13][2].splice(e[13][2].indexOf(u),1),e[13][2].splice(e[13][2].indexOf(f),1),E&&E.d(),m&&T(C),N&&N.d(m),m&&T(d),_=!1,j(A)}}}function Ne(e){let t,o,i,n,p,c,u,v;return{c(){t=r("p"),t.textContent=`If multiple organizations under the same GitHub Enterprise Server need to use the runners,
|
|
17
|
+
you can make the app public.`,o=b(),i=r("div"),n=r("input"),p=b(),c=r("label"),c.textContent="Public app",s(t,"class","pt-2"),s(n,"class","form-check-input"),s(n,"type","checkbox"),s(n,"id","public"),s(c,"class","form-check-label"),s(c,"for","public"),s(i,"class","form-check")},m(a,h){H(a,t,h),H(a,o,h),H(a,i,h),l(i,n),n.checked=e[10].public,l(i,p),l(i,c),u||(v=$(n,"change",e[21]),u=!0)},p(a,h){h&1024&&(n.checked=a[10].public)},d(a){a&&T(t),a&&T(o),a&&T(i),u=!1,v()}}}function Ie(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C;return{c(){t=r("h3"),t.textContent="Organization name",o=b(),i=r("div"),n=r("p"),p=I(`What is the slug for your organization? If your repositories have a URL like
|
|
18
|
+
`),c=r("code"),u=I("https://"),v=I(e[1]),a=I("/MyOrg/my-repo"),h=I(`
|
|
19
|
+
then your organization slug is `),g=r("code"),g.textContent="MyOrg",f=I("."),O=b(),k=r("input"),s(k,"class","form-control"),s(i,"class","px-3 py-3")},m(d,_){H(d,t,_),H(d,o,_),H(d,i,_),l(i,n),l(n,p),l(n,c),l(c,u),l(c,v),l(c,a),l(n,h),l(n,g),l(n,f),l(i,O),l(i,k),M(k,e[4]),S||(C=$(k,"input",e[22]),S=!0)},p(d,_){_&2&&ce(v,d[1]),_&16&&k.value!==d[4]&&M(k,d[4])},d(d){d&&T(t),d&&T(o),d&&T(i),S=!1,C()}}}function nt(e){let t,o,i;return{c(){t=r("div"),o=I(e[9]),s(t,"class",i="alert alert-"+(e[8]?"success":"danger")),s(t,"role","alert")},m(n,p){H(n,t,p),l(t,o)},p(n,p){p&512&&ce(o,n[9]),p&256&&i!==(i="alert alert-"+(n[8]?"success":"danger"))&&s(t,"class",i)},d(n){n&&T(t)}}}function lt(e){let t;return{c(){t=r("p"),t.textContent="This button will be enabled once all the questions above are answered."},m(o,i){H(o,t,i)},p:Y,d(o){o&&T(t)}}}function Ge(e){let t,o,i,n,p,c;return{c(){t=r("p"),o=r("b"),o.textContent="WARNING:",i=I(" using a public app means anyone with access to "),n=r("code"),p=I(e[1]),c=I(`
|
|
20
20
|
can use the runners you're setting up now. Anyone can create a workflow that will run on those runners,
|
|
21
21
|
have access to their instance profile, and be part of their security group. Consider the security
|
|
22
|
-
implications before continuing.`),s(o,"class","text-danger")},m(u,v){H(u,t,v),l(t,o),l(t,i),l(t,n),l(n,
|
|
22
|
+
implications before continuing.`),s(o,"class","text-danger")},m(u,v){H(u,t,v),l(t,o),l(t,i),l(t,n),l(n,p),l(t,c)},p(u,v){v&2&&ce(p,u[1])},d(u){u&&T(t)}}}function it(e){let t,o,i,n,p,c,u,v,a,h,g,f,O,k,S,C,d,_,A,E,N,m,w,te,q,ne,Z,Q,V,X,B,z,pe,fe,J,le=Pe(e[2])+"",de,ie,ye,K,W,oe,se,_e,we,R=e[0]==="ghes"&&Oe(e),P=e[0]&&He(e);function Ee(y,G){if(y[2]==="newApp")return tt;if(y[2]==="existingApp")return et;if(y[2]==="pat")return xe}let F=Ee(e),L=F&&F(e);function Ae(y,G){return y[9]===void 0?lt:nt}let re=Ae(e),D=re(e),U=e[10].public&&e[2]==="newApp"&&Ge(e);return{c(){t=r("main"),o=r("div"),i=r("div"),n=r("form"),p=r("h1"),p.textContent="Setup GitHub Runners",c=b(),u=r("p"),v=I(`Answer all the questions on this page to automatically configure GitHub integration and get the
|
|
23
23
|
runners working. This page will not be accessible once you complete this operation. If you ever want
|
|
24
24
|
to access it again, edit `),a=r("code"),a.textContent=`${ot}`,h=I(" and run the status function again."),g=b(),f=r("h3"),f.textContent="Choose GitHub Instance",O=b(),k=r("div"),S=r("p"),S.textContent=`Are your repositories hosted on GitHub.com or are you using an on-premise installation of GitHub
|
|
25
|
-
Enterprise Server?`,C=b(),d=r("div"),_=r("input"),A=b(),E=r("label"),E.textContent="GitHub.com",N=b(),m=r("div"),w=r("input"),te=b(),q=r("label"),q.textContent="GitHub Enterprise Server",ne=b(),R&&R.c(),Z=b(),P&&P.c(),Q=b(),L&&L.c(),V=b(),X=r("h2"),X.textContent="Finish Setup",
|
|
25
|
+
Enterprise Server?`,C=b(),d=r("div"),_=r("input"),A=b(),E=r("label"),E.textContent="GitHub.com",N=b(),m=r("div"),w=r("input"),te=b(),q=r("label"),q.textContent="GitHub Enterprise Server",ne=b(),R&&R.c(),Z=b(),P&&P.c(),Q=b(),L&&L.c(),V=b(),X=r("h2"),X.textContent="Finish Setup",B=b(),z=r("div"),D.c(),pe=b(),U&&U.c(),fe=b(),J=r("button"),de=I(le),ye=b(),K=r("form"),W=r("input"),s(_,"class","form-check-input"),s(_,"type","radio"),_.__value="github.com",_.value=_.__value,s(_,"id","github.com"),e[13][0].push(_),s(E,"class","form-check-label"),s(E,"for","github.com"),s(d,"class","form-check"),s(w,"class","form-check-input"),s(w,"type","radio"),w.__value="ghes",w.value=w.__value,s(w,"id","ghes"),e[13][0].push(w),s(q,"class","form-check-label"),s(q,"for","ghes"),s(m,"class","form-check"),s(k,"class","px-3 py-3"),s(J,"type","submit"),s(J,"class","btn btn-success"),J.disabled=ie=Re(e[0],e[2],e[5],e[6],e[7],e[8]),s(z,"class","px-3 py-3"),s(n,"class","col"),s(i,"class","row"),s(o,"class","container py-3 px-2"),s(W,"type","hidden"),s(W,"name","manifest"),W.value=oe=JSON.stringify(e[10]),s(K,"action",se="https://"+e[1]+"/"+(e[3]==="org"?`organizations/${e[4]}/`:"")+"settings/apps/new?state="+ge),s(K,"method","post"),s(K,"id","appform")},m(y,G){H(y,t,G),l(t,o),l(o,i),l(i,n),l(n,p),l(n,c),l(n,u),l(u,v),l(u,a),l(u,h),l(n,g),l(n,f),l(n,O),l(n,k),l(k,S),l(k,C),l(k,d),l(d,_),_.checked=_.__value===e[0],l(d,A),l(d,E),l(k,N),l(k,m),l(m,w),w.checked=w.__value===e[0],l(m,te),l(m,q),l(n,ne),R&&R.m(n,null),l(n,Z),P&&P.m(n,null),l(n,Q),L&&L.m(n,null),l(n,V),l(n,X),l(n,B),l(n,z),D.m(z,null),l(z,pe),U&&U.m(z,null),l(z,fe),l(z,J),l(J,de),l(t,ye),l(t,K),l(K,W),_e||(we=[$(_,"change",e[12]),$(w,"change",e[14]),$(n,"submit",e[11])],_e=!0)},p(y,[G]){G&1&&(_.checked=_.__value===y[0]),G&1&&(w.checked=w.__value===y[0]),y[0]==="ghes"?R?R.p(y,G):(R=Oe(y),R.c(),R.m(n,Z)):R&&(R.d(1),R=null),y[0]?P?P.p(y,G):(P=He(y),P.c(),P.m(n,Q)):P&&(P.d(1),P=null),F===(F=Ee(y))&&L?L.p(y,G):(L&&L.d(1),L=F&&F(y),L&&(L.c(),L.m(n,V))),re===(re=Ae(y))&&D?D.p(y,G):(D.d(1),D=re(y),D&&(D.c(),D.m(z,pe))),y[10].public&&y[2]==="newApp"?U?U.p(y,G):(U=Ge(y),U.c(),U.m(z,fe)):U&&(U.d(1),U=null),G&4&&le!==(le=Pe(y[2])+"")&&ce(de,le),G&485&&ie!==(ie=Re(y[0],y[2],y[5],y[6],y[7],y[8]))&&(J.disabled=ie),G&1024&&oe!==(oe=JSON.stringify(y[10]))&&(W.value=oe),G&26&&se!==(se="https://"+y[1]+"/"+(y[3]==="org"?`organizations/${y[4]}/`:"")+"settings/apps/new?state="+ge)&&s(K,"action",se)},i:Y,o:Y,d(y){y&&T(t),e[13][0].splice(e[13][0].indexOf(_),1),e[13][0].splice(e[13][0].indexOf(w),1),R&&R.d(),P&&P.d(),L&&L.d(),D.d(),U&&U.d(),_e=!1,j(we)}}}const ot="INSERT_SECRET_ARN_HERE",ge="INSERT_TOKEN_HERE";function Re(e,t,o,i,n,p){return p||e===void 0||t===void 0?!0:t==="newApp"?!1:t==="existingApp"?o===""||i==="":t==="pat"?n==="":(console.error("Something is broken",e,t,o),!0)}function Pe(e){return e==="newApp"?"Create GitHub App":"Setup"}function me(e,t){return new Promise((o,i)=>{fetch(`${e}?token=${ge}`,{method:"POST",mode:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),redirect:"error"}).then(n=>{n.ok?n.text().then(o).catch(i):n.text().then(p=>{i(new Error(`${p} [${n.status}]`))}).catch(i)}).catch(i)})}function st(e,t,o){let i,n="INSERT_DOMAIN_HERE",p,c="user",u="ORGANIZATION",v="",a="",h="",g,f;const O={url:"https://github.com/CloudSnorkel/cdk-github-runners",hook_attributes:{url:"INSERT_WEBHOOK_URL_HERE"},redirect_url:"INSERT_BASE_URL_HERE/complete-new-app",public:!1,default_permissions:{actions:"write",administration:"write"},default_events:["workflow_job"]};function k(V){V.preventDefault();function X(){const B=i==="ghes"?n:"github.com";switch(p){case"newApp":return me("domain",{domain:B}).then(z=>(document.getElementById("appform").submit(),Promise.resolve("Redirecting to GitHub...")));case"existingApp":return me("app",{appid:v,pk:a,domain:B});case"pat":return me("pat",{pat:h,domain:B})}}X().then(B=>{o(9,f=B),o(8,g=!0)}).catch(B=>{o(9,f=`${B}`),o(8,g=!1)})}const S=[[],[],[]];function C(){i=this.__value,o(0,i)}function d(){i=this.__value,o(0,i)}function _(){n=this.value,o(1,n)}function A(){p=this.__value,o(2,p)}function E(){p=this.__value,o(2,p)}function N(){p=this.__value,o(2,p)}function m(){c=this.__value,o(3,c)}function w(){c=this.__value,o(3,c)}function te(){O.public=this.checked,o(10,O)}function q(){u=this.value,o(4,u)}function ne(){v=$e(this.value),o(5,v)}function Z(){a=this.value,o(6,a)}function Q(){h=this.value,o(7,h)}return[i,n,p,c,u,v,a,h,g,f,O,k,C,S,d,_,A,E,N,m,w,te,q,ne,Z,Q]}class rt extends Xe{constructor(t){super(),Ve(this,t,st,it,Be,{})}}new rt({target:document.getElementById("app")});
|
|
26
26
|
|
|
27
27
|
</script>
|
|
28
28
|
<style type="text/css">
|
|
@@ -8887,7 +8887,7 @@ function response(code, body) {
|
|
|
8887
8887
|
statusCode: code,
|
|
8888
8888
|
headers: {
|
|
8889
8889
|
"Content-Type": "text/html",
|
|
8890
|
-
"Content-Security-Policy": `default-src 'nonce-${nonce}'; img-src data:; connect-src 'self'; form-action https:; frame-ancestors 'none'`
|
|
8890
|
+
"Content-Security-Policy": `default-src 'unsafe-inline' 'nonce-${nonce}'; img-src data:; connect-src 'self'; form-action https:; frame-ancestors 'none'; object-src 'none'; base-uri 'self'`
|
|
8891
8891
|
},
|
|
8892
8892
|
body
|
|
8893
8893
|
};
|