ec2-github-runner icon indicating copy to clipboard operation
ec2-github-runner copied to clipboard

stop action fails to find Github runner though the labeled runner does exist

Open scottdickerson opened this issue 2 years ago • 2 comments

This results in lots of offline runners piling up in our repository. The EC2 instance is killed successfully but the runner isn't removed

image

Run machulav/ec2-github-runner@v2
  with:
    mode: stop
    github-token: ***
    label: shk8d
   <removed for security>
    aws-resource-tags: []
  env:

    AWS_DEFAULT_REGION: <removed>
    AWS_REGION: <removed>
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
AWS EC2 instance <removed-for-security> is terminated
GitHub self-hosted runner with label shk8d is not found, so the removal is skipped

scottdickerson avatar Oct 21 '22 19:10 scottdickerson

I think another possible fix for this is to just allow us to create these tagged as ephemeral runners and github will supposedly remove them automatically after 1 day (instead of 30 days)

scottdickerson avatar Oct 21 '22 20:10 scottdickerson

this turned out to be a permissions problem with my github-token. I think we would have caught this issue much sooner if this line was improved to actually show the error: https://github.com/machulav/ec2-github-runner/blob/4e0303de215db88e1c489e07a15ca4d867f488ea/src/gh.js#L16

scottdickerson avatar Dec 07 '22 17:12 scottdickerson