actions-marketplace-validations/On-demand self-hosted AWS EC2 runner for GitHub Actions
GitHub Action for automatic creation and registration AWS EC2 instance as a GitHub Actions self-hosted runner.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Apr 10, 2026
- License
- MIT
Pinned Snippet
uses: actions-marketplace-validations/machulav_ec2-github-runner@343a1b2ae682e681c3cec9a235d882da17ff04ef # no releases — HEAD as of 2026-07-13tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| mode | Specify here which mode you want to use: - 'start' - to start a new runner; - 'stop' - to stop the previously created runner. | yes | — |
| github-token | GitHub Personal Access Token with the 'repo' scope assigned. | yes | — |
| availability-zones-config | 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. | no | — |
| ec2-image-id | 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. | no | — |
| ec2-instance-type | EC2 Instance Type. This input is required if you use the 'start' mode. | no | — |
| subnet-id | 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. | no | — |
| security-group-id | 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. | no | — |
| label | 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. | no | — |
| ec2-instance-id | 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. | no | — |
| iam-role-name | IAM Role Name to attach to the created EC2 instance. This requires additional permissions on the AWS role used to launch instances. | no | — |
| aws-resource-tags | 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"}]' | no | [] |
| runner-home-dir | Directory that contains actions-runner software and scripts. E.g. /home/runner/actions-runner. | no | — |
| pre-runner-script | Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc. | no | — |
| market-type | Specifies the market (purchasing) option for the instance: - 'spot' - Use a spot instance | no | — |
| block-device-mappings | JSON string specifying the block device mappings for the EC2 instance. Example: '[{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 100, "VolumeType": "gp3"}}]' | no | — |
| startup-quiet-period-seconds | Specifies the quiet period in seconds after the instance starts. The runner will not be registered during this period. | no | — |
| startup-retry-interval-seconds | Specifies the retry interval in seconds to register the runner after the quiet period. | no | — |
| startup-timeout-minutes | Specifies the timeout in minutes to register the runner after the quiet period. | no | 5 |
| run-runner-as-service | Start the runner as a service rather than using ./run.sh as root. | no | false |
| run-runner-as-user | Specify user under whom the runner service should run | no | — |
| ec2-volume-size | EC2 volume size in GB. | no | — |
| ec2-device-name | EC2 block device name. | no | /dev/sda1 |
| ec2-volume-type | EC2 block device type. | no | — |
| metadata-options | JSON string specifying the metadata options for the EC2 instance. Example: '{"HttpTokens": "required", "HttpEndpoint": "enabled", "HttpPutResponseHopLimit": 2, "InstanceMetadataTags": "enabled"}' | — | — |
| packages | JSON array of packages to install via cloud-init. Example: '["git", "docker.io", "nodejs"]' | no | [] |
| use-jit | 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'. | no | false |
| runner-group-id | 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. | no | 1 |
| runner-debug | Enable verbose debug logging for the runner setup. When true, outputs detailed instance info, console output polling, and step-by-step script execution logs. | no | false |
Outputs
| name | description |
|---|---|
| label | 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 | EC2 Instance Id of the created runner. The id is used to terminate the EC2 instance when the runner is not needed anymore. |
| region | AWS region where the EC2 instance was created. This is useful for subsequent AWS operations on the instance. |