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 GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Apr 10, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: actions-marketplace-validations/machulav_ec2-github-runner@343a1b2ae682e681c3cec9a235d882da17ff04ef # no releases — HEAD as of 2026-07-13

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
modeSpecify here which mode you want to use: - 'start' - to start a new runner; - 'stop' - to stop the previously created runner.yes
github-tokenGitHub Personal Access Token with the 'repo' scope assigned.yes
availability-zones-configJSON 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-idEC2 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-typeEC2 Instance Type. This input is required if you use the 'start' mode.no
subnet-idVPC 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-idEC2 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
labelName 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-idEC2 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-nameIAM Role Name to attach to the created EC2 instance. This requires additional permissions on the AWS role used to launch instances.no
aws-resource-tagsTags 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-dirDirectory that contains actions-runner software and scripts. E.g. /home/runner/actions-runner.no
pre-runner-scriptSpecifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc.no
market-typeSpecifies the market (purchasing) option for the instance: - 'spot' - Use a spot instanceno
block-device-mappingsJSON string specifying the block device mappings for the EC2 instance. Example: '[{"DeviceName": "/dev/sda1", "Ebs": {"VolumeSize": 100, "VolumeType": "gp3"}}]'no
startup-quiet-period-secondsSpecifies the quiet period in seconds after the instance starts. The runner will not be registered during this period.no
startup-retry-interval-secondsSpecifies the retry interval in seconds to register the runner after the quiet period.no
startup-timeout-minutesSpecifies the timeout in minutes to register the runner after the quiet period.no5
run-runner-as-serviceStart the runner as a service rather than using ./run.sh as root.nofalse
run-runner-as-userSpecify user under whom the runner service should runno
ec2-volume-sizeEC2 volume size in GB.no
ec2-device-nameEC2 block device name.no/dev/sda1
ec2-volume-typeEC2 block device type.no
metadata-optionsJSON string specifying the metadata options for the EC2 instance. Example: '{"HttpTokens": "required", "HttpEndpoint": "enabled", "HttpPutResponseHopLimit": 2, "InstanceMetadataTags": "enabled"}'
packagesJSON array of packages to install via cloud-init. Example: '["git", "docker.io", "nodejs"]'no[]
use-jitEnable 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'.nofalse
runner-group-idThe 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.no1
runner-debugEnable verbose debug logging for the runner setup. When true, outputs detailed instance info, console output polling, and step-by-step script execution logs.nofalse
namedescription
labelName 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-idEC2 Instance Id of the created runner. The id is used to terminate the EC2 instance when the runner is not needed anymore.
regionAWS region where the EC2 instance was created. This is useful for subsequent AWS operations on the instance.