machulav / ec2-github-runner

On-demand self-hosted AWS EC2 runner for GitHub Actions
MIT License
747 stars 337 forks source link

Add 'pre-runner-script' option #154

Closed tonyhutter closed 1 year ago

tonyhutter commented 1 year ago

Add a pre-runner-script option to specify arbitrary bash commands to run before the runner starts up on the instance. This is useful if you need to install dependencies or have OS-specific setup steps. For example:

          - name: Start EC2 runner
            with:
              mode: start
              ec2-image-id: ami-07bdb09c49774f92e
              pre-runner-script: |
                 sudo yum update -y && \
                 sudo yum install docker git libicu -y && \
                 sudo systemctl enable docker
tonyhutter commented 1 year ago

The lint-code check has been running for a day. I'm not sure what's going on with that.

tonyhutter commented 1 year ago

@machulav would you mind taking a look at this? I have a few more PRs that I want to submit after this one gets in.

tonyhutter commented 1 year ago

@machulav thanks for you suggestions. I've included them all in my latest push.

mickmorse commented 1 year ago

I get this when using pre-runner-script

Warning: Unexpected input(s) 'pre-runner-script', valid inputs are ['mode', 'github-token', 'ec2-image-id', 'ec2-instance-type', 'subnet-id', 'security-group-id', 'label', 'ec2-instance-id', 'iam-role-name', 'aws-resource-tags', 'runner-home-dir']

Any reason why? as it is a valid input in actions.yml

mickmorse commented 1 year ago

ah nvm it's not tagged that's why. are we expecting a new tag soon?

wu-json commented 1 year ago

+1 can we get a new tag?

Johannes-Renderheads commented 1 year ago

@machulav any way we can get a new release that includes the pre-runner-script option?

machulav commented 11 months ago

The new tag with this feature is released: v2.3.4. Also, the major version tag v2 was updated.

I'm sorry for such a long delays. I don't have much time supporting this project anymore. Will make an announcement in discussions soon.