Skip to content

Commit c454bad

Browse files
Get latest runner (machulav#245)
1 parent f168118 commit c454bad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/aws.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ function buildUserDataScript(githubRegistrationToken, label) {
2626
`echo "${config.input.preRunnerScript}" > pre-runner-script.sh`,
2727
'source pre-runner-script.sh',
2828
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
29-
'curl -O -L https://github.com/actions/runner/releases/download/v2.313.0/actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
30-
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.313.0.tar.gz',
29+
'RUNNER_VERSION=$(curl -s "https://api.github.com/repos/actions/runner/releases/latest" | jq -r ".name" | tr -d "v")',
30+
'curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz',
31+
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz',
3132
'export RUNNER_ALLOW_RUNASROOT=1',
3233
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
3334
];
@@ -192,4 +193,4 @@ module.exports = {
192193
startEc2Instance,
193194
terminateEc2Instance,
194195
waitForInstanceRunning,
195-
};
196+
};

0 commit comments

Comments
 (0)