diff --git a/dist/index.js b/dist/index.js index 1f5e4e57..8935b2e7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -55143,7 +55143,7 @@ function buildUserDataScript(githubRegistrationToken, label) { `cd "${config.input.runnerHomeDir}"`, 'export RUNNER_ALLOW_RUNASROOT=1', 'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1', - 'export INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)', + 'export INSTANCE_ID=$(cat /var/lib/cloud/data/instance-id)', `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label}`, './run.sh', ]; @@ -55152,13 +55152,15 @@ function buildUserDataScript(githubRegistrationToken, label) { '#!/bin/bash', 'mkdir actions-runner && cd actions-runner', 'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}', - 'curl -O -L https://github.com/actions/runner/releases/download/v2.280.3/actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz', - 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz', + 'curl -O -L https://github.com/actions/runner/releases/download/v2.283.2/actions-runner-linux-${RUNNER_ARCH}-2.283.2.tar.gz', + 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.283.2.tar.gz', 'export RUNNER_ALLOW_RUNASROOT=1', 'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1', - 'export INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label}`, - './run.sh', + 'export INSTANCE_ID=$(cat /var/lib/cloud/data/instance-id)', + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label} --ephemeral`, + "sed -i 's/\\(ExecStart=.*\\)/\\1\\nExecStopPost=shutdown -h now/' bin/actions.runner.service.template", + 'sudo ./svc.sh install', + 'sudo ./svc.sh start', ]; } } diff --git a/src/aws.js b/src/aws.js index f1588f87..e6a6d840 100644 --- a/src/aws.js +++ b/src/aws.js @@ -21,13 +21,15 @@ function buildUserDataScript(githubRegistrationToken, label) { '#!/bin/bash', 'mkdir actions-runner && cd actions-runner', 'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}', - 'curl -O -L https://github.com/actions/runner/releases/download/v2.280.3/actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz', - 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.280.3.tar.gz', + 'curl -O -L https://github.com/actions/runner/releases/download/v2.283.2/actions-runner-linux-${RUNNER_ARCH}-2.283.2.tar.gz', + 'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.283.2.tar.gz', 'export RUNNER_ALLOW_RUNASROOT=1', 'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1', 'export INSTANCE_ID=$(cat /var/lib/cloud/data/instance-id)', - `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label}`, - './run.sh', + `./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --name "$INSTANCE_ID" --labels ${label} --ephemeral`, + "sed -i 's/\\(ExecStart=.*\\)/\\1\\nExecStopPost=shutdown -h now/' bin/actions.runner.service.template", + 'sudo ./svc.sh install', + 'sudo ./svc.sh start', ]; } }