diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index cdfcfc0..a11b8ed 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -29,7 +29,8 @@ jobs: run: go version shell: bash - name: Verify 'node' - run: | - node --version - npm --version + run: node --version + shell: bash + - name: Verify 'npm' + run: npm --version shell: bash diff --git a/docker-compose.yml b/docker-compose.yml index b4464cf..ebfddf5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,4 @@ --- -version: '0.0.1' - services: runner: image: runner:latest diff --git a/scripts/start.sh b/scripts/start.sh index 228f8d0..f7ab73b 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -39,15 +39,19 @@ else echo "Unknown OS: $(uname)" fi -DEFAULT_LABEL="$os_name-$architecture" -RUNNER_SUFFIX="$(head -c 20 /dev/urandom | tr -dc 'a-z0-9' | fold -w 5 | head -n 1)" -DEFAULT_RUNNER_NAME="docker-node-${RUNNER_SUFFIX}" +instance_id() { + # Use randomly generated instance IDs (AWS format) as default runner names + letters=$(tr -dc '[:lower:]' < /dev/urandom | head -c 4) + digits=$(tr -dc '0-9' < /dev/urandom | head -c 12) + eid=$(echo "$letters$digits" | fold -w1 | shuf | tr -d '\n') + echo "0$eid" +} # Env vars (docker-compose.yml) -RUNNER_NAME="${RUNNER_NAME:-$DEFAULT_RUNNER_NAME}" -RUNNER_GROUP="${RUNNER_GROUP:-default}" -WORK_DIR="${WORK_DIR:-_work}" -LABELS="${LABELS:-$DEFAULT_LABEL}" +RUNNER_NAME="${RUNNER_NAME:-"i-$(instance_id)"}" +RUNNER_GROUP="${RUNNER_GROUP:-"default"}" +WORK_DIR="${WORK_DIR:-"_work"}" +LABELS="${LABELS:-"docker-node,$os_name-$architecture"}" repo_level_runner() { # https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository