From 84d98d2a54a8df79338d5267f3c97a072ba82f7a Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 31 Aug 2026 17:40:49 -0600 Subject: [PATCH] Resolve the runner version at boot so Windows runners can register again Fetch the latest actions/runner release when the instance starts, rather than installing a version pinned in this repository. GitHub refuses registration for self-hosted runners below 2.329.0 and the pin sat at 2.309.0. Track the latest release rather than advancing the pin, since a runner more than thirty days behind the newest release is also refused from running jobs. A fixed version needs a commit every month to stay usable, and a lapsed month reads as an intermittent runner failure rather than an expired pin. --- dist/index.js | 8 ++++---- src/aws.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6cc377e0..be51eba5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -159662,8 +159662,6 @@ const { EC2Client, RunInstancesCommand, TerminateInstancesCommand, waitUntilInst const core = __webpack_require__(42186); const config = __webpack_require__(34570); -const runnerVersion = '2.309.0' - // User data scripts are run as the root user function buildUserDataScript(githubRegistrationToken, label) { core.info(`Building data script for ${config.input.ec2Os}`) @@ -159689,8 +159687,10 @@ function buildUserDataScript(githubRegistrationToken, label) { 'mkdir C:\\actions-runner; cd C:\\actions-runner', 'echo "${config.input.preRunnerScript}" > pre-runner-script.ps1', '& pre-runner-script.ps1', - `Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v${runnerVersion}/actions-runner-win-x64-${runnerVersion}.zip -OutFile actions-runner-win-x64-${runnerVersion}.zip`, - `Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-${runnerVersion}.zip", "$PWD")`, + "$runnerVersion = (Invoke-RestMethod -Uri https://api.github.com/repos/actions/runner/releases/latest).tag_name.TrimStart('v')", + '$runnerZip = "actions-runner-win-x64-$runnerVersion.zip"', + 'Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/v$runnerVersion/$runnerZip" -OutFile $runnerZip', + 'Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$runnerZip", "$PWD")', `./config.cmd --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name ${label} --unattended`, './run.cmd', '', diff --git a/src/aws.js b/src/aws.js index ba1ab8db..017e1c53 100644 --- a/src/aws.js +++ b/src/aws.js @@ -2,8 +2,6 @@ const { EC2Client, RunInstancesCommand, TerminateInstancesCommand, waitUntilInst const core = require('@actions/core'); const config = require('./config'); -const runnerVersion = '2.309.0' - // User data scripts are run as the root user function buildUserDataScript(githubRegistrationToken, label) { core.info(`Building data script for ${config.input.ec2Os}`) @@ -29,8 +27,10 @@ function buildUserDataScript(githubRegistrationToken, label) { 'mkdir C:\\actions-runner; cd C:\\actions-runner', 'echo "${config.input.preRunnerScript}" > pre-runner-script.ps1', '& pre-runner-script.ps1', - `Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v${runnerVersion}/actions-runner-win-x64-${runnerVersion}.zip -OutFile actions-runner-win-x64-${runnerVersion}.zip`, - `Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-${runnerVersion}.zip", "$PWD")`, + "$runnerVersion = (Invoke-RestMethod -Uri https://api.github.com/repos/actions/runner/releases/latest).tag_name.TrimStart('v')", + '$runnerZip = "actions-runner-win-x64-$runnerVersion.zip"', + 'Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/v$runnerVersion/$runnerZip" -OutFile $runnerZip', + 'Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$runnerZip", "$PWD")', `./config.cmd --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label} --name ${label} --unattended`, './run.cmd', '',