Skip to content

Commit e13c955

Browse files
applied this: machulav#162
1 parent fcfb31a commit e13c955

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ Now you're ready to go!
200200
| `ec2-instance-type` | Required if you use the `start` mode. | EC2 Instance Type. |
201201
| `subnet-id` | Required if you use the `start` mode. | VPC Subnet Id. <br><br> The subnet should belong to the same VPC as the specified security group. |
202202
| `security-group-id` | Required if you use the `start` mode. | EC2 Security Group Id. <br><br> The security group should belong to the same VPC as the specified subnet. <br><br> Only the outbound traffic for port 443 should be allowed. No inbound traffic is required. |
203+
| `key-name` | Required if you use the `start` mode. | EC2 Key Pair name. <br><br> Can be assigned to the EC2 instance so user can SSH in for debuging. |
204+
| `storage-path` | Required if you use the `start` mode. | EC2 Block Storage Volume. <br><br> Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance. The parameter `storage-size` must also be configured when using this parameter. |
205+
| `storage-size` | Required if you use the `start` mode. | EC2 Block Storage Volume. <br><br> Used for overriding volume size of the machine if your project exceed the 8GiB default storage. The parameter `storage-path` must also be configured when using this parameter. |
203206
| `label` | Required if you use the `stop` mode. | Name of the unique label assigned to the runner. <br><br> The label is provided by the output of the action in the `start` mode. <br><br> The label is used to remove the runner from GitHub when the runner is not needed anymore. |
204207
| `ec2-instance-id` | Required if you use the `stop` mode. | EC2 Instance Id of the created runner. <br><br> The id is provided by the output of the action in the `start` mode. <br><br> The id is used to terminate the EC2 instance when the runner is not needed anymore. |
205208
| `iam-role-name` | Optional. Used only with the `start` mode. | IAM role name to attach to the created EC2 runner. <br><br> This allows the runner to have permissions to run additional actions within the AWS account, without having to manage additional GitHub secrets and AWS users. <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |

action.yml

+17
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ inputs:
3737
The runner doesn't require any inbound traffic. However, outbound traffic should be allowed.
3838
This input is required if you use the 'start' mode.
3939
required: false
40+
key-name:
41+
description: >-
42+
EC2 Key Pair name.
43+
Can be assigned to the EC2 instance so user can SSH in for debuging.
44+
required: false
45+
storage-path:
46+
description: >-
47+
EC2 Block Storage Volume.
48+
Used for configuring the mount path of the volume if you're overriding the default volume size of the EC2 instance.
49+
The parameter `storage-size` must also be configured when using this parameter.
50+
required: false
51+
storage-size:
52+
description: >-
53+
EC2 Block Storage Volume.
54+
Used for overriding volume size of the machine if your project exceed the 8GiB default storage.
55+
The parameter `storage-path` must also be configured when using this parameter.
56+
required: false
4057
label:
4158
description: >-
4259
Name of the unique label assigned to the runner.

src/aws.js

+11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ async function startEc2Instance(label, githubRegistrationToken) {
4747
SecurityGroupIds: [config.input.securityGroupId],
4848
IamInstanceProfile: { Name: config.input.iamRoleName },
4949
TagSpecifications: config.tagSpecifications,
50+
KeyName: config.keyName,
51+
BlockDeviceMappings: [
52+
{
53+
DeviceName: config.storagePath,
54+
Ebs: {
55+
DeleteOnTermination: true,
56+
VolumeSize: config.storageSize,
57+
},
58+
},
59+
],
60+
5061
};
5162

5263
try {

src/config.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class Config {
1010
ec2InstanceType: core.getInput('ec2-instance-type'),
1111
subnetId: core.getInput('subnet-id'),
1212
securityGroupId: core.getInput('security-group-id'),
13+
keyName: core.getInput('key-name'),
14+
storagePath: core.getInput('storage-path'),
15+
storageSize: core.getInput('storage-size'),
1316
label: core.getInput('label'),
1417
ec2InstanceId: core.getInput('ec2-instance-id'),
1518
iamRoleName: core.getInput('iam-role-name'),

0 commit comments

Comments
 (0)