From bf5cb7c4d75fc882de82454beb6160d7351066f1 Mon Sep 17 00:00:00 2001 From: Mario Minardi Date: Sun, 26 Oct 2025 17:53:07 -0600 Subject: [PATCH] src: check against platform specific versions for latest and unstable Check against platform and package specific version numbers returned from pkgs.tailscale.com instead of defaulting to "Version" as this can be incorrect for certain platforms when a release has only been built for a subset of platforms. For example. 1.90.2 is available for linux at the time of writing so "Version" is 1.90.2, but only 1.90.1 is available for windows which causes an error when using latest as the version specifier on windows machines. Fixes https://github.com/tailscale/github-action/issues/219 Signed-off-by: Mario Minardi --- dist/index.js | 12 +++++++++++- src/main.ts | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9d8cd16..c9093c9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41306,7 +41306,17 @@ async function resolveVersion(version, runnerOS) { pkg, ]); const response = JSON.parse(stdout); - return response.Version; + switch (runnerOS) { + case runnerLinux: + return response.TarballsVersion; + case runnerMacOS: + // Use latest tag on macOS since we are building from source + return response.Version; + case runnerWindows: + return response.MSIsVersion; + default: + return response.Version; + } } return version; } diff --git a/src/main.ts b/src/main.ts index e50073d..eba52c9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -262,7 +262,17 @@ async function resolveVersion( pkg, ]); const response = JSON.parse(stdout); - return response.Version; + switch (runnerOS) { + case runnerLinux: + return response.TarballsVersion; + case runnerMacOS: + // Use latest tag on macOS since we are building from source + return response.Version; + case runnerWindows: + return response.MSIsVersion; + default: + return response.Version; + } } return version;