This repository was archived by the owner on Mar 25, 2026. It is now read-only.
forked from machulav/ec2-github-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
177 lines (177 loc) · 7.09 KB
/
action.yml
File metadata and controls
177 lines (177 loc) · 7.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: On-demand self-hosted AWS EC2 runner for GitHub Actions
description: GitHub Action for automatic creation and registration AWS EC2 instance as a GitHub Actions self-hosted runner.
author: Volodymyr Machula
branding:
icon: 'box'
color: 'orange'
inputs:
mode:
description: >-
Specify here which mode you want to use:
- 'start' - to start a new runner;
- 'stop' - to stop the previously created runner.
required: true
github-token:
description: >-
GitHub Personal Access Token with the 'repo' scope assigned.
required: true
availability-zones-config:
description: >-
JSON string array of objects with configurations for multiple availability zones.
Each object should contain 'imageId', 'subnetId', and 'securityGroupId'.
Optionally, you can specify 'region' to launch the instance in a specific AWS region.
If 'region' is not specified, the default AWS_REGION environment variable will be used.
Example: '[{"imageId":"ami-123","subnetId":"subnet-123","securityGroupId":"sg-123"},{"imageId":"ami-456","subnetId":"subnet-456","securityGroupId":"sg-456","region":"us-west-2"}]'
When provided, the action will try each configuration in sequence until a successful instance is launched.
This takes precedence over individual ec2-image-id, subnet-id, and security-group-id parameters.
required: false
ec2-image-id:
description: >-
EC2 Image Id (AMI). The new runner will be launched from this image.
This input is required if you use the 'start' mode and don't provide availability-zones-config.
required: false
ec2-instance-type:
description: >-
EC2 Instance Type.
This input is required if you use the 'start' mode.
required: false
subnet-id:
description: >-
VPC Subnet Id. The subnet should belong to the same VPC as the specified security group.
This input is required if you use the 'start' mode and don't provide availability-zones-config.
required: false
security-group-id:
description: >-
EC2 Security Group Id.
The security group should belong to the same VPC as the specified subnet.
The runner doesn't require any inbound traffic. However, outbound traffic should be allowed.
This input is required if you use the 'start' mode and don't provide availability-zones-config.
required: false
label:
description: >-
Name of the unique label assigned to the runner.
The label is used to remove the runner from GitHub when the runner is not needed anymore.
This input is required if you use the 'stop' mode.
required: false
ec2-instance-id:
description: >-
EC2 Instance Id of the created runner.
The id is used to terminate the EC2 instance when the runner is not needed anymore.
This input is required if you use the 'stop' mode.
required: false
iam-role-name:
description: >-
IAM Role Name to attach to the created EC2 instance.
This requires additional permissions on the AWS role used to launch instances.
required: false
aws-resource-tags:
description: >-
Tags to attach to the launched EC2 instance and volume.
This must be a stringified array of AWS Tag objects, with both Key and Value fields,
for example: '[{"Key": "TagKey1", "Value": "TagValue1"}, {"Key": "TagKey2", "Value": "TagValue2"}]'
required: false
default: '[]'
runner-home-dir:
description: >-
Directory that contains actions-runner software and scripts. E.g. /home/runner/actions-runner.
required: false
pre-runner-script:
description: >-
Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc.
required: false
market-type:
description: >-
Specifies the market (purchasing) option for the instance:
- 'spot' - Use a spot instance
required: false
block-device-mappings:
description: >-
JSON string specifying the block device mappings for the EC2 instance.
Example: '[{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 100, "VolumeType": "gp3"}}]'
required: false
startup-quiet-period-seconds:
description: >-
Specifies the quiet period in seconds after the instance starts.
The runner will not be registered during this period.
required: false
startup-retry-interval-seconds:
description: >-
Specifies the retry interval in seconds to register the runner after the quiet period.
required: false
startup-timeout-minutes:
description: >-
Specifies the timeout in minutes to register the runner after the quiet period.
required: false
default: '5'
run-runner-as-service:
description: >-
Start the runner as a service rather than using ./run.sh as root.
required: false
default: 'false'
run-runner-as-user:
description: >-
Specify user under whom the runner service should run
required: false
ec2-volume-size:
description: >-
EC2 volume size in GB.
required: false
ec2-device-name:
description: >-
EC2 block device name.
default: /dev/sda1
required: false
ec2-volume-type:
description: >-
EC2 block device type.
required: false
metadata-options:
description: >-
JSON string specifying the metadata options for the EC2 instance.
Example: '{"HttpTokens": "required", "HttpEndpoint": "enabled", "HttpPutResponseHopLimit": 2, "InstanceMetadataTags": "enabled"}'
packages:
description: >-
JSON array of packages to install via cloud-init.
Example: '["git", "docker.io", "nodejs"]'
required: false
default: '[]'
use-jit:
description: >-
Enable JIT (Just-In-Time) runner configuration. Uses GitHub's
generate-jitconfig API instead of the traditional registration-token approach.
JIT runners are single-use and auto-deregister after completing one job.
Incompatible with 'run-runner-as-service: true'.
required: false
default: 'false'
runner-group-id:
description: >-
The ID of the runner group to register the JIT runner in.
Defaults to 1, which is the "Default" runner group for repository-level runners.
Only used when 'use-jit' is true.
required: false
default: '1'
runner-debug:
description: >-
Enable verbose debug logging for the runner setup.
When true, outputs detailed instance info, console output polling,
and step-by-step script execution logs.
required: false
default: 'false'
outputs:
label:
description: >-
Name of the unique label assigned to the runner.
The label is used in two cases:
- to use as the input of 'runs-on' property for the following jobs;
- to remove the runner from GitHub when it is not needed anymore.
ec2-instance-id:
description: >-
EC2 Instance Id of the created runner.
The id is used to terminate the EC2 instance when the runner is not needed anymore.
region:
description: >-
AWS region where the EC2 instance was created.
This is useful for subsequent AWS operations on the instance.
runs:
using: node20
main: ./dist/index.js