diff --git a/README.md b/README.md index 9c74d3ad..5d189060 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ Check the [internal docs](https://docs.shiphero.xyz/ci.html#horizontally-scaled- This allows to save around 45' on the "start" step. - Reverted in 5659035ee505 because we was hitting Github rate limits for personal tokens. + Reverted in [5659035ee505](https://github.com/Shiphero/ec2-github-runner/commit/5659035ee5055b3c32cd4d104ccfa339472250b0) because we were hitting Github's rate limit for personal tokens. - [Increases the page size when listing runners](https://github.com/Shiphero/ec2-github-runner/pull/2/commits/e3aae63b6a8bd136b0fd9460468dc85097a8d273) to reduce the number or requests to Github API. +- [Avoid failures when other runners are already registered with same name](https://github.com/Shiphero/ec2-github-runner/pull/4) by assigning a random name to the instances. \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index f3b9f55e..70b0a32d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65276,7 +65276,7 @@ function buildUserDataScript(githubRegistrationToken, label) { `echo "${config.input.preRunnerScript}" > pre-runner-script.sh`, 'source pre-runner-script.sh', 'export RUNNER_ALLOW_RUNASROOT=1', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`, + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`, './run.sh', ]; } else { @@ -65289,7 +65289,7 @@ function buildUserDataScript(githubRegistrationToken, label) { 'curl -O -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz', 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz', 'export RUNNER_ALLOW_RUNASROOT=1', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`, + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`, './run.sh', ]; } @@ -72193,4 +72193,4 @@ module.exports = require("zlib");; /******/ // Load entry module and return exports /******/ return __webpack_require__(4351); /******/ })() -; \ No newline at end of file +; diff --git a/src/aws.js b/src/aws.js index 7d5a4ada..9aa65416 100644 --- a/src/aws.js +++ b/src/aws.js @@ -13,7 +13,7 @@ function buildUserDataScript(githubRegistrationToken, label) { `echo "${config.input.preRunnerScript}" > pre-runner-script.sh`, 'source pre-runner-script.sh', 'export RUNNER_ALLOW_RUNASROOT=1', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`, + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`, './run.sh', ]; } else { @@ -26,7 +26,7 @@ function buildUserDataScript(githubRegistrationToken, label) { 'curl -O -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz', 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz', 'export RUNNER_ALLOW_RUNASROOT=1', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`, + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name $(hostname)-$(uuidgen)`, './run.sh', ]; }