From 786e21840455c528022e195811a50ac865fdc097 Mon Sep 17 00:00:00 2001 From: Yonatan Romero Date: Thu, 8 Aug 2024 17:48:31 +0800 Subject: [PATCH 1/2] Merging https://github.com/machulav/ec2-github-runner/pull/127 --- dist/index.js | 6 +++--- src/aws.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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', ]; } From cf3bce79525e3118f549b50e8bacac088d790d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Gait=C3=A1n?= Date: Thu, 8 Aug 2024 08:38:37 -0300 Subject: [PATCH 2/2] mention fix in the readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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