@cloudsnorkel/cdk-github-runners 0.7.5 → 0.8.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/.jsii +361 -97
- package/API.md +190 -1
- package/lib/lambdas/delete-runner/index.js +80 -4
- package/lib/lambdas/setup/index.html +4 -4
- package/lib/lambdas/setup/index.js +61 -2
- package/lib/lambdas/status/index.js +80 -4
- package/lib/lambdas/token-retriever/index.js +80 -4
- package/lib/lambdas/update-lambda/index.js +54 -19
- package/lib/lambdas/webhook-handler/index.js +7 -0
- package/lib/providers/codebuild.d.ts +7 -1
- package/lib/providers/codebuild.js +12 -6
- package/lib/providers/common.d.ts +13 -3
- package/lib/providers/common.js +4 -4
- package/lib/providers/docker-images/lambda/linux-arm64/runner.sh +3 -0
- package/lib/providers/docker-images/lambda/linux-x64/runner.sh +3 -0
- package/lib/providers/ec2.d.ts +8 -3
- package/lib/providers/ec2.js +74 -44
- package/lib/providers/fargate.d.ts +7 -1
- package/lib/providers/fargate.js +16 -8
- package/lib/providers/image-builders/ami.d.ts +7 -1
- package/lib/providers/image-builders/ami.js +25 -21
- package/lib/providers/image-builders/codebuild.js +1 -1
- package/lib/providers/image-builders/common.js +1 -1
- package/lib/providers/image-builders/container.d.ts +1 -1
- package/lib/providers/image-builders/container.js +11 -11
- package/lib/providers/image-builders/linux-components.d.ts +1 -1
- package/lib/providers/image-builders/linux-components.js +19 -19
- package/lib/providers/image-builders/static.js +6 -6
- package/lib/providers/image-builders/windows-components.d.ts +1 -1
- package/lib/providers/image-builders/windows-components.js +12 -12
- package/lib/providers/lambda.d.ts +7 -1
- package/lib/providers/lambda.js +5 -3
- package/lib/runner.d.ts +27 -1
- package/lib/runner.js +83 -6
- package/lib/secrets.js +1 -1
- package/package.json +7 -7
package/API.md
CHANGED
|
@@ -621,6 +621,7 @@ Any object.
|
|
|
621
621
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
|
|
622
622
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.image">image</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage">RunnerImage</a></code> | Docker image loaded with GitHub Actions Runner and its prerequisites. |
|
|
623
623
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with this provider. |
|
|
624
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
|
|
624
625
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.project">project</a></code> | <code>aws-cdk-lib.aws_codebuild.Project</code> | CodeBuild project hosting the runner. |
|
|
625
626
|
|
|
626
627
|
---
|
|
@@ -687,6 +688,20 @@ Labels associated with this provider.
|
|
|
687
688
|
|
|
688
689
|
---
|
|
689
690
|
|
|
691
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.logGroup"></a>
|
|
692
|
+
|
|
693
|
+
```typescript
|
|
694
|
+
public readonly logGroup: ILogGroup;
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
698
|
+
|
|
699
|
+
Log group where provided runners will save their logs.
|
|
700
|
+
|
|
701
|
+
Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
|
|
702
|
+
|
|
703
|
+
---
|
|
704
|
+
|
|
690
705
|
##### `project`<sup>Required</sup> <a name="project" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.project"></a>
|
|
691
706
|
|
|
692
707
|
```typescript
|
|
@@ -1106,6 +1121,7 @@ Any object.
|
|
|
1106
1121
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
|
|
1107
1122
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
|
|
1108
1123
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with this provider. |
|
|
1124
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
|
|
1109
1125
|
|
|
1110
1126
|
---
|
|
1111
1127
|
|
|
@@ -1157,6 +1173,20 @@ Labels associated with this provider.
|
|
|
1157
1173
|
|
|
1158
1174
|
---
|
|
1159
1175
|
|
|
1176
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.Ec2Runner.property.logGroup"></a>
|
|
1177
|
+
|
|
1178
|
+
```typescript
|
|
1179
|
+
public readonly logGroup: ILogGroup;
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
1183
|
+
|
|
1184
|
+
Log group where provided runners will save their logs.
|
|
1185
|
+
|
|
1186
|
+
Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
|
|
1187
|
+
|
|
1188
|
+
---
|
|
1189
|
+
|
|
1160
1190
|
|
|
1161
1191
|
### FargateRunner <a name="FargateRunner" id="@cloudsnorkel/cdk-github-runners.FargateRunner"></a>
|
|
1162
1192
|
|
|
@@ -1310,6 +1340,7 @@ Any object.
|
|
|
1310
1340
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
|
|
1311
1341
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.image">image</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage">RunnerImage</a></code> | Docker image loaded with GitHub Actions Runner and its prerequisites. |
|
|
1312
1342
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with this provider. |
|
|
1343
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
|
|
1313
1344
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.spot">spot</a></code> | <code>boolean</code> | Use spot pricing for Fargate tasks. |
|
|
1314
1345
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.task">task</a></code> | <code>aws-cdk-lib.aws_ecs.FargateTaskDefinition</code> | Fargate task hosting the runner. |
|
|
1315
1346
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.subnetSelection">subnetSelection</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | Subnets used for hosting the runner task. |
|
|
@@ -1415,6 +1446,20 @@ Labels associated with this provider.
|
|
|
1415
1446
|
|
|
1416
1447
|
---
|
|
1417
1448
|
|
|
1449
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.logGroup"></a>
|
|
1450
|
+
|
|
1451
|
+
```typescript
|
|
1452
|
+
public readonly logGroup: ILogGroup;
|
|
1453
|
+
```
|
|
1454
|
+
|
|
1455
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
1456
|
+
|
|
1457
|
+
Log group where provided runners will save their logs.
|
|
1458
|
+
|
|
1459
|
+
Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
|
|
1460
|
+
|
|
1461
|
+
---
|
|
1462
|
+
|
|
1418
1463
|
##### `spot`<sup>Required</sup> <a name="spot" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.spot"></a>
|
|
1419
1464
|
|
|
1420
1465
|
```typescript
|
|
@@ -1590,6 +1635,10 @@ new GitHubRunners(scope: Construct, id: string, props?: GitHubRunnersProps)
|
|
|
1590
1635
|
| **Name** | **Description** |
|
|
1591
1636
|
| --- | --- |
|
|
1592
1637
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
1638
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed">metricFailed</a></code> | Metric for failed runner executions. |
|
|
1639
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricJobCompleted">metricJobCompleted</a></code> | Metric for the number of GitHub Actions jobs completed. |
|
|
1640
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricSucceeded">metricSucceeded</a></code> | Metric for successful executions. |
|
|
1641
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricTime">metricTime</a></code> | Metric for the interval, in milliseconds, between the time the execution starts and the time it closes. |
|
|
1593
1642
|
|
|
1594
1643
|
---
|
|
1595
1644
|
|
|
@@ -1601,6 +1650,74 @@ public toString(): string
|
|
|
1601
1650
|
|
|
1602
1651
|
Returns a string representation of this construct.
|
|
1603
1652
|
|
|
1653
|
+
##### `metricFailed` <a name="metricFailed" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed"></a>
|
|
1654
|
+
|
|
1655
|
+
```typescript
|
|
1656
|
+
public metricFailed(props?: MetricProps): Metric
|
|
1657
|
+
```
|
|
1658
|
+
|
|
1659
|
+
Metric for failed runner executions.
|
|
1660
|
+
|
|
1661
|
+
A failed runner usually means the runner failed to start and so a job was never executed. It doesn't necessarily mean the job was executed and failed. For that, see {@link metricJobCompleted}.
|
|
1662
|
+
|
|
1663
|
+
###### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed.parameter.props"></a>
|
|
1664
|
+
|
|
1665
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricProps
|
|
1666
|
+
|
|
1667
|
+
---
|
|
1668
|
+
|
|
1669
|
+
##### `metricJobCompleted` <a name="metricJobCompleted" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricJobCompleted"></a>
|
|
1670
|
+
|
|
1671
|
+
```typescript
|
|
1672
|
+
public metricJobCompleted(props?: MetricProps): Metric
|
|
1673
|
+
```
|
|
1674
|
+
|
|
1675
|
+
Metric for the number of GitHub Actions jobs completed.
|
|
1676
|
+
|
|
1677
|
+
It has `ProviderLabels` and `Status` dimensions. The status can be one of "Succeeded", "SucceededWithIssues", "Failed", "Canceled", "Skipped", or "Abandoned".
|
|
1678
|
+
|
|
1679
|
+
**WARNING:** this method creates a metric filter for each provider. Each metric has a status dimension with six possible values. These resources may incur cost.
|
|
1680
|
+
|
|
1681
|
+
###### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricJobCompleted.parameter.props"></a>
|
|
1682
|
+
|
|
1683
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricProps
|
|
1684
|
+
|
|
1685
|
+
---
|
|
1686
|
+
|
|
1687
|
+
##### `metricSucceeded` <a name="metricSucceeded" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricSucceeded"></a>
|
|
1688
|
+
|
|
1689
|
+
```typescript
|
|
1690
|
+
public metricSucceeded(props?: MetricProps): Metric
|
|
1691
|
+
```
|
|
1692
|
+
|
|
1693
|
+
Metric for successful executions.
|
|
1694
|
+
|
|
1695
|
+
A successful execution doesn't always mean a runner was started. It can be successful even without any label matches.
|
|
1696
|
+
|
|
1697
|
+
A successful runner doesn't mean the job it executed was successful. For that, see {@link metricJobCompleted}.
|
|
1698
|
+
|
|
1699
|
+
###### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricSucceeded.parameter.props"></a>
|
|
1700
|
+
|
|
1701
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricProps
|
|
1702
|
+
|
|
1703
|
+
---
|
|
1704
|
+
|
|
1705
|
+
##### `metricTime` <a name="metricTime" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricTime"></a>
|
|
1706
|
+
|
|
1707
|
+
```typescript
|
|
1708
|
+
public metricTime(props?: MetricProps): Metric
|
|
1709
|
+
```
|
|
1710
|
+
|
|
1711
|
+
Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.
|
|
1712
|
+
|
|
1713
|
+
This time may be longer than the time the runner took.
|
|
1714
|
+
|
|
1715
|
+
###### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricTime.parameter.props"></a>
|
|
1716
|
+
|
|
1717
|
+
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricProps
|
|
1718
|
+
|
|
1719
|
+
---
|
|
1720
|
+
|
|
1604
1721
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
1605
1722
|
|
|
1606
1723
|
| **Name** | **Description** |
|
|
@@ -2083,6 +2200,7 @@ Any object.
|
|
|
2083
2200
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
|
|
2084
2201
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.image">image</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerImage">RunnerImage</a></code> | Docker image loaded with GitHub Actions Runner and its prerequisites. |
|
|
2085
2202
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with this provider. |
|
|
2203
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
|
|
2086
2204
|
|
|
2087
2205
|
---
|
|
2088
2206
|
|
|
@@ -2160,6 +2278,20 @@ Labels associated with this provider.
|
|
|
2160
2278
|
|
|
2161
2279
|
---
|
|
2162
2280
|
|
|
2281
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.property.logGroup"></a>
|
|
2282
|
+
|
|
2283
|
+
```typescript
|
|
2284
|
+
public readonly logGroup: ILogGroup;
|
|
2285
|
+
```
|
|
2286
|
+
|
|
2287
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
2288
|
+
|
|
2289
|
+
Log group where provided runners will save their logs.
|
|
2290
|
+
|
|
2291
|
+
Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
|
|
2292
|
+
|
|
2293
|
+
---
|
|
2294
|
+
|
|
2163
2295
|
#### Constants <a name="Constants" id="Constants"></a>
|
|
2164
2296
|
|
|
2165
2297
|
| **Name** | **Type** | **Description** |
|
|
@@ -2379,6 +2511,7 @@ const amiBuilderProps: AmiBuilderProps = { ... }
|
|
|
2379
2511
|
| **Name** | **Type** | **Description** |
|
|
2380
2512
|
| --- | --- | --- |
|
|
2381
2513
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.architecture">architecture</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Architecture">Architecture</a></code> | Image architecture. |
|
|
2514
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.installDocker">installDocker</a></code> | <code>boolean</code> | Install Docker inside the image, so it can be used by the runner. |
|
|
2382
2515
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.instanceType">instanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | The instance type used to build the image. |
|
|
2383
2516
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.logRemovalPolicy">logRemovalPolicy</a></code> | <code>aws-cdk-lib.RemovalPolicy</code> | Removal policy for logs of image builds. |
|
|
2384
2517
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
|
|
@@ -2405,6 +2538,21 @@ Image architecture.
|
|
|
2405
2538
|
|
|
2406
2539
|
---
|
|
2407
2540
|
|
|
2541
|
+
##### `installDocker`<sup>Optional</sup> <a name="installDocker" id="@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.installDocker"></a>
|
|
2542
|
+
|
|
2543
|
+
```typescript
|
|
2544
|
+
public readonly installDocker: boolean;
|
|
2545
|
+
```
|
|
2546
|
+
|
|
2547
|
+
- *Type:* boolean
|
|
2548
|
+
- *Default:* true
|
|
2549
|
+
|
|
2550
|
+
Install Docker inside the image, so it can be used by the runner.
|
|
2551
|
+
|
|
2552
|
+
You may want to disable this if you are building a Windows image and don't have a Docker Desktop license.
|
|
2553
|
+
|
|
2554
|
+
---
|
|
2555
|
+
|
|
2408
2556
|
##### `instanceType`<sup>Optional</sup> <a name="instanceType" id="@cloudsnorkel/cdk-github-runners.AmiBuilderProps.property.instanceType"></a>
|
|
2409
2557
|
|
|
2410
2558
|
```typescript
|
|
@@ -5691,7 +5839,7 @@ Log group name for the image builder where history of image builds can be analyz
|
|
|
5691
5839
|
|
|
5692
5840
|
### IRunnerProvider <a name="IRunnerProvider" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider"></a>
|
|
5693
5841
|
|
|
5694
|
-
- *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable
|
|
5842
|
+
- *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable, constructs.IConstruct
|
|
5695
5843
|
|
|
5696
5844
|
- *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner">CodeBuildRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner">Ec2Runner</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunner">FargateRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner">LambdaRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
|
|
5697
5845
|
|
|
@@ -5770,7 +5918,9 @@ grantable for the status function.
|
|
|
5770
5918
|
| --- | --- | --- |
|
|
5771
5919
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
|
|
5772
5920
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
|
|
5921
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
5773
5922
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.labels">labels</a></code> | <code>string[]</code> | GitHub Actions labels used for this provider. |
|
|
5923
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
|
|
5774
5924
|
|
|
5775
5925
|
---
|
|
5776
5926
|
|
|
@@ -5798,6 +5948,18 @@ The principal to grant permissions to.
|
|
|
5798
5948
|
|
|
5799
5949
|
---
|
|
5800
5950
|
|
|
5951
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.node"></a>
|
|
5952
|
+
|
|
5953
|
+
```typescript
|
|
5954
|
+
public readonly node: Node;
|
|
5955
|
+
```
|
|
5956
|
+
|
|
5957
|
+
- *Type:* constructs.Node
|
|
5958
|
+
|
|
5959
|
+
The tree node.
|
|
5960
|
+
|
|
5961
|
+
---
|
|
5962
|
+
|
|
5801
5963
|
##### `labels`<sup>Required</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.labels"></a>
|
|
5802
5964
|
|
|
5803
5965
|
```typescript
|
|
@@ -5814,6 +5976,20 @@ job's labels, this provider will be chosen and spawn a new runner.
|
|
|
5814
5976
|
|
|
5815
5977
|
---
|
|
5816
5978
|
|
|
5979
|
+
##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.property.logGroup"></a>
|
|
5980
|
+
|
|
5981
|
+
```typescript
|
|
5982
|
+
public readonly logGroup: ILogGroup;
|
|
5983
|
+
```
|
|
5984
|
+
|
|
5985
|
+
- *Type:* aws-cdk-lib.aws_logs.ILogGroup
|
|
5986
|
+
|
|
5987
|
+
Log group where provided runners will save their logs.
|
|
5988
|
+
|
|
5989
|
+
Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
|
|
5990
|
+
|
|
5991
|
+
---
|
|
5992
|
+
|
|
5817
5993
|
### IRunnerProviderStatus <a name="IRunnerProviderStatus" id="@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus"></a>
|
|
5818
5994
|
|
|
5819
5995
|
- *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus">IRunnerProviderStatus</a>
|
|
@@ -5829,6 +6005,7 @@ Interface for runner image status used by status.json.
|
|
|
5829
6005
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.type">type</a></code> | <code>string</code> | Runner provider type. |
|
|
5830
6006
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.ami">ami</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerAmiStatus">IRunnerAmiStatus</a></code> | Details about AMI used by this runner provider. |
|
|
5831
6007
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.image">image</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageStatus">IRunnerImageStatus</a></code> | Details about Docker image used by this runner provider. |
|
|
6008
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.logGroup">logGroup</a></code> | <code>string</code> | Log group for runners. |
|
|
5832
6009
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.roleArn">roleArn</a></code> | <code>string</code> | Role attached to runners. |
|
|
5833
6010
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.securityGroups">securityGroups</a></code> | <code>string[]</code> | Security groups attached to runners. |
|
|
5834
6011
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.vpcArn">vpcArn</a></code> | <code>string</code> | VPC where runners will be launched. |
|
|
@@ -5883,6 +6060,18 @@ Details about Docker image used by this runner provider.
|
|
|
5883
6060
|
|
|
5884
6061
|
---
|
|
5885
6062
|
|
|
6063
|
+
##### `logGroup`<sup>Optional</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.logGroup"></a>
|
|
6064
|
+
|
|
6065
|
+
```typescript
|
|
6066
|
+
public readonly logGroup: string;
|
|
6067
|
+
```
|
|
6068
|
+
|
|
6069
|
+
- *Type:* string
|
|
6070
|
+
|
|
6071
|
+
Log group for runners.
|
|
6072
|
+
|
|
6073
|
+
---
|
|
6074
|
+
|
|
5886
6075
|
##### `roleArn`<sup>Optional</sup> <a name="roleArn" id="@cloudsnorkel/cdk-github-runners.IRunnerProviderStatus.property.roleArn"></a>
|
|
5887
6076
|
|
|
5888
6077
|
```typescript
|
|
@@ -6849,6 +6849,11 @@ var require_lib3 = __commonJS({
|
|
|
6849
6849
|
const dest = new URL$1(destination).hostname;
|
|
6850
6850
|
return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest);
|
|
6851
6851
|
};
|
|
6852
|
+
var isSameProtocol = function isSameProtocol2(destination, original) {
|
|
6853
|
+
const orig = new URL$1(original).protocol;
|
|
6854
|
+
const dest = new URL$1(destination).protocol;
|
|
6855
|
+
return orig === dest;
|
|
6856
|
+
};
|
|
6852
6857
|
function fetch(url, opts) {
|
|
6853
6858
|
if (!fetch.Promise) {
|
|
6854
6859
|
throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
|
|
@@ -6864,7 +6869,7 @@ var require_lib3 = __commonJS({
|
|
|
6864
6869
|
let error = new AbortError("The user aborted a request.");
|
|
6865
6870
|
reject(error);
|
|
6866
6871
|
if (request.body && request.body instanceof Stream.Readable) {
|
|
6867
|
-
request.body
|
|
6872
|
+
destroyStream(request.body, error);
|
|
6868
6873
|
}
|
|
6869
6874
|
if (!response || !response.body)
|
|
6870
6875
|
return;
|
|
@@ -6899,8 +6904,29 @@ var require_lib3 = __commonJS({
|
|
|
6899
6904
|
}
|
|
6900
6905
|
req.on("error", function(err) {
|
|
6901
6906
|
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err));
|
|
6907
|
+
if (response && response.body) {
|
|
6908
|
+
destroyStream(response.body, err);
|
|
6909
|
+
}
|
|
6902
6910
|
finalize();
|
|
6903
6911
|
});
|
|
6912
|
+
fixResponseChunkedTransferBadEnding(req, function(err) {
|
|
6913
|
+
if (signal && signal.aborted) {
|
|
6914
|
+
return;
|
|
6915
|
+
}
|
|
6916
|
+
destroyStream(response.body, err);
|
|
6917
|
+
});
|
|
6918
|
+
if (parseInt(process.version.substring(1)) < 14) {
|
|
6919
|
+
req.on("socket", function(s) {
|
|
6920
|
+
s.addListener("close", function(hadError) {
|
|
6921
|
+
const hasDataListener = s.listenerCount("data") > 0;
|
|
6922
|
+
if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
|
|
6923
|
+
const err = new Error("Premature close");
|
|
6924
|
+
err.code = "ERR_STREAM_PREMATURE_CLOSE";
|
|
6925
|
+
response.body.emit("error", err);
|
|
6926
|
+
}
|
|
6927
|
+
});
|
|
6928
|
+
});
|
|
6929
|
+
}
|
|
6904
6930
|
req.on("response", function(res) {
|
|
6905
6931
|
clearTimeout(reqTimeout);
|
|
6906
6932
|
const headers = createHeadersLenient(res.headers);
|
|
@@ -6951,7 +6977,7 @@ var require_lib3 = __commonJS({
|
|
|
6951
6977
|
timeout: request.timeout,
|
|
6952
6978
|
size: request.size
|
|
6953
6979
|
};
|
|
6954
|
-
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
|
6980
|
+
if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
|
|
6955
6981
|
for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
|
|
6956
6982
|
requestOpts.headers.delete(name);
|
|
6957
6983
|
}
|
|
@@ -7012,6 +7038,12 @@ var require_lib3 = __commonJS({
|
|
|
7012
7038
|
response = new Response(body, response_options);
|
|
7013
7039
|
resolve(response);
|
|
7014
7040
|
});
|
|
7041
|
+
raw.on("end", function() {
|
|
7042
|
+
if (!response) {
|
|
7043
|
+
response = new Response(body, response_options);
|
|
7044
|
+
resolve(response);
|
|
7045
|
+
}
|
|
7046
|
+
});
|
|
7015
7047
|
return;
|
|
7016
7048
|
}
|
|
7017
7049
|
if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
|
|
@@ -7026,6 +7058,33 @@ var require_lib3 = __commonJS({
|
|
|
7026
7058
|
writeToStream(req, request);
|
|
7027
7059
|
});
|
|
7028
7060
|
}
|
|
7061
|
+
function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
7062
|
+
let socket;
|
|
7063
|
+
request.on("socket", function(s) {
|
|
7064
|
+
socket = s;
|
|
7065
|
+
});
|
|
7066
|
+
request.on("response", function(response) {
|
|
7067
|
+
const headers = response.headers;
|
|
7068
|
+
if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) {
|
|
7069
|
+
response.once("close", function(hadError) {
|
|
7070
|
+
const hasDataListener = socket.listenerCount("data") > 0;
|
|
7071
|
+
if (hasDataListener && !hadError) {
|
|
7072
|
+
const err = new Error("Premature close");
|
|
7073
|
+
err.code = "ERR_STREAM_PREMATURE_CLOSE";
|
|
7074
|
+
errorCallback(err);
|
|
7075
|
+
}
|
|
7076
|
+
});
|
|
7077
|
+
}
|
|
7078
|
+
});
|
|
7079
|
+
}
|
|
7080
|
+
function destroyStream(stream, err) {
|
|
7081
|
+
if (stream.destroy) {
|
|
7082
|
+
stream.destroy(err);
|
|
7083
|
+
} else {
|
|
7084
|
+
stream.emit("error", err);
|
|
7085
|
+
stream.end();
|
|
7086
|
+
}
|
|
7087
|
+
}
|
|
7029
7088
|
fetch.isRedirect = function(code) {
|
|
7030
7089
|
return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
|
|
7031
7090
|
};
|
|
@@ -8785,7 +8844,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8785
8844
|
var authOauthDevice = require_dist_node13();
|
|
8786
8845
|
var oauthMethods = require_dist_node12();
|
|
8787
8846
|
var btoa = _interopDefault(require_btoa_node());
|
|
8788
|
-
var VERSION = "2.0
|
|
8847
|
+
var VERSION = "2.1.0";
|
|
8789
8848
|
async function getAuthentication(state) {
|
|
8790
8849
|
if ("code" in state.strategyOptions) {
|
|
8791
8850
|
const {
|
|
@@ -8794,6 +8853,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8794
8853
|
clientId: state.clientId,
|
|
8795
8854
|
clientSecret: state.clientSecret,
|
|
8796
8855
|
clientType: state.clientType,
|
|
8856
|
+
onTokenCreated: state.onTokenCreated,
|
|
8797
8857
|
...state.strategyOptions,
|
|
8798
8858
|
request: state.request
|
|
8799
8859
|
});
|
|
@@ -8807,6 +8867,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8807
8867
|
const deviceAuth = authOauthDevice.createOAuthDeviceAuth({
|
|
8808
8868
|
clientType: state.clientType,
|
|
8809
8869
|
clientId: state.clientId,
|
|
8870
|
+
onTokenCreated: state.onTokenCreated,
|
|
8810
8871
|
...state.strategyOptions,
|
|
8811
8872
|
request: state.request
|
|
8812
8873
|
});
|
|
@@ -8825,6 +8886,7 @@ var require_dist_node14 = __commonJS({
|
|
|
8825
8886
|
clientId: state.clientId,
|
|
8826
8887
|
clientSecret: state.clientSecret,
|
|
8827
8888
|
clientType: state.clientType,
|
|
8889
|
+
onTokenCreated: state.onTokenCreated,
|
|
8828
8890
|
...state.strategyOptions
|
|
8829
8891
|
};
|
|
8830
8892
|
}
|
|
@@ -8857,12 +8919,16 @@ var require_dist_node14 = __commonJS({
|
|
|
8857
8919
|
}
|
|
8858
8920
|
}
|
|
8859
8921
|
if (options.type === "refresh") {
|
|
8922
|
+
var _state$onTokenCreated;
|
|
8860
8923
|
if (state.clientType === "oauth-app") {
|
|
8861
8924
|
throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
|
|
8862
8925
|
}
|
|
8863
8926
|
if (!currentAuthentication.hasOwnProperty("expiresAt")) {
|
|
8864
8927
|
throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
|
|
8865
8928
|
}
|
|
8929
|
+
await ((_state$onTokenCreated = state.onTokenCreated) === null || _state$onTokenCreated === void 0 ? void 0 : _state$onTokenCreated.call(state, state.authentication, {
|
|
8930
|
+
type: options.type
|
|
8931
|
+
}));
|
|
8866
8932
|
}
|
|
8867
8933
|
if (options.type === "check" || options.type === "reset") {
|
|
8868
8934
|
const method = options.type === "check" ? oauthMethods.checkToken : oauthMethods.resetToken;
|
|
@@ -8883,6 +8949,12 @@ var require_dist_node14 = __commonJS({
|
|
|
8883
8949
|
// @ts-expect-error TBD
|
|
8884
8950
|
...authentication
|
|
8885
8951
|
};
|
|
8952
|
+
if (options.type === "reset") {
|
|
8953
|
+
var _state$onTokenCreated2;
|
|
8954
|
+
await ((_state$onTokenCreated2 = state.onTokenCreated) === null || _state$onTokenCreated2 === void 0 ? void 0 : _state$onTokenCreated2.call(state, state.authentication, {
|
|
8955
|
+
type: options.type
|
|
8956
|
+
}));
|
|
8957
|
+
}
|
|
8886
8958
|
return state.authentication;
|
|
8887
8959
|
} catch (error) {
|
|
8888
8960
|
if (error.status === 404) {
|
|
@@ -8947,12 +9019,14 @@ var require_dist_node14 = __commonJS({
|
|
|
8947
9019
|
"user-agent": `octokit-auth-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
|
|
8948
9020
|
}
|
|
8949
9021
|
}),
|
|
9022
|
+
onTokenCreated,
|
|
8950
9023
|
...strategyOptions
|
|
8951
9024
|
}) {
|
|
8952
9025
|
const state = Object.assign({
|
|
8953
9026
|
clientType,
|
|
8954
9027
|
clientId,
|
|
8955
9028
|
clientSecret,
|
|
9029
|
+
onTokenCreated,
|
|
8956
9030
|
strategyOptions,
|
|
8957
9031
|
request: request$1
|
|
8958
9032
|
});
|
|
@@ -13796,7 +13870,9 @@ var require_lodash = __commonJS({
|
|
|
13796
13870
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
|
|
13797
13871
|
for (var key in value) {
|
|
13798
13872
|
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
13799
|
-
(key == "length" ||
|
|
13873
|
+
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
13874
|
+
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
13875
|
+
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
13800
13876
|
isIndex(key, length)))) {
|
|
13801
13877
|
result2.push(key);
|
|
13802
13878
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
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 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
|
|
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 Q(){}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 te(e){ke=e}const Z=[],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 Y=0;function ze(){if(Y!==0)return;const e=ke;do{try{for(;Y<Z.length;){const t=Z[Y];Y++,te(t),Ke(t.$$)}}catch(t){throw Z.length=0,Y=0,t}for(te(null),Z.length=0,Y=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(Z.length);for(;Te.length;)Te.pop()();be=!1,he.clear(),te(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&&(Z.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;te(e);const a=e.$$={fragment:null,ctx:[],props:p,update:Q,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()}te(v)}class Xe{$destroy(){Ze(this,1),this.$destroy=Q}$on(t,o){if(!Ue(o))return Q;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
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
|
|
@@ -16,13 +16,13 @@
|
|
|
16
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
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
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:
|
|
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:Q,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,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,
|
|
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,ne,q,le,V,X,x,ee,B,z,pe,fe,J,ie=Pe(e[2])+"",de,oe,ye,K,W,se,re,_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 ue=Ae(e),D=ue(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"),
|
|
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"),ne=b(),q=r("label"),q.textContent="GitHub Enterprise Server",le=b(),R&&R.c(),V=b(),P&&P.c(),X=b(),L&&L.c(),x=b(),ee=r("h2"),ee.textContent="Finish Setup",B=b(),z=r("div"),D.c(),pe=b(),U&&U.c(),fe=b(),J=r("button"),de=I(ie),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=oe=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=se=JSON.stringify(e[10]),s(K,"action",re="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,ne),l(m,q),l(n,le),R&&R.m(n,null),l(n,V),P&&P.m(n,null),l(n,X),L&&L.m(n,null),l(n,x),l(n,ee),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,V)):R&&(R.d(1),R=null),y[0]?P?P.p(y,G):(P=He(y),P.c(),P.m(n,X)):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,x))),ue===(ue=Ae(y))&&D?D.p(y,G):(D.d(1),D=ue(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&&ie!==(ie=Pe(y[2])+"")&&ce(de,ie),G&485&&oe!==(oe=Re(y[0],y[2],y[5],y[6],y[7],y[8]))&&(J.disabled=oe),G&1024&&se!==(se=JSON.stringify(y[10]))&&(W.value=se),G&26&&re!==(re="https://"+y[1]+"/"+(y[3]==="org"?`organizations/${y[4]}/`:"")+"settings/apps/new?state="+ge)&&s(K,"action",re)},i:Q,o:Q,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(x){x.preventDefault();function ee(){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})}}ee().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 ne(){O.public=this.checked,o(10,O)}function q(){u=this.value,o(4,u)}function le(){v=$e(this.value),o(5,v)}function V(){a=this.value,o(6,a)}function X(){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,ne,q,le,V,X]}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">
|