From 5f88897c7520a44bdbf36a88c9e477e3875f42c7 Mon Sep 17 00:00:00 2001 From: Sucukdeluxe <259325684+Sucukdeluxe@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:21:14 +0200 Subject: [PATCH] fix(ci): accept the lowercase RUNNER_OS reported by Gitea act runners The live managed-tool smoke and the real installer smoke gated on RUNNER_OS being exactly Windows. The Gitea act runner reports the value as lowercase windows, so both gates rejected the approved self-hosted git.24-music.de runner and the corresponding verify steps could never run there. The gates now compare RUNNER_OS case-insensitively while keeping every other identity requirement unchanged, with contract coverage for the lowercase Gitea identity. --- scripts/smoke-test-installer.js | 3 ++- scripts/smoke-test-installer.test.js | 8 ++++++++ scripts/smoke-test-managed-tools-live.js | 3 ++- scripts/smoke-test-managed-tools-live.test.js | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/smoke-test-installer.js b/scripts/smoke-test-installer.js index c68634b..2679682 100644 --- a/scripts/smoke-test-installer.js +++ b/scripts/smoke-test-installer.js @@ -236,7 +236,8 @@ function assertHostedWindowsCi(environment = process.env, platform = process.pla const serverUrl = String(environment.GITHUB_SERVER_URL || '').replace(/\/+$/, '').toLowerCase(); const isGitHubActions = environment.GITHUB_ACTIONS === 'true' && environment.GITEA_ACTIONS !== 'true' && environment.RUNNER_ENVIRONMENT === 'github-hosted' && serverUrl === 'https://github.com'; const isGiteaActions = environment.GITEA_ACTIONS === 'true' && serverUrl === 'https://git.24-music.de'; - if (platform !== 'win32' || environment.CI !== 'true' || environment.RUNNER_OS !== 'Windows' || !environment.RUNNER_TEMP || !environment.GITHUB_RUN_ID || (!isGitHubActions && !isGiteaActions)) { + const runnerOs = String(environment.RUNNER_OS || '').toLowerCase(); + if (platform !== 'win32' || environment.CI !== 'true' || runnerOs !== 'windows' || !environment.RUNNER_TEMP || !environment.GITHUB_RUN_ID || (!isGitHubActions && !isGiteaActions)) { throw new Error('Real installer smoke is restricted to an approved Windows Actions runner'); } } diff --git a/scripts/smoke-test-installer.test.js b/scripts/smoke-test-installer.test.js index 40d4125..d59ad38 100644 --- a/scripts/smoke-test-installer.test.js +++ b/scripts/smoke-test-installer.test.js @@ -59,6 +59,14 @@ test('real installer smoke accepts the git.24-music.de Gitea Windows Actions ide RUNNER_OS: 'Windows', RUNNER_TEMP: 'C:\\runner-temp' }, 'win32')); + assert.doesNotThrow(() => assertHostedWindowsCi({ + CI: 'true', + GITEA_ACTIONS: 'true', + GITHUB_RUN_ID: '456', + GITHUB_SERVER_URL: 'https://git.24-music.de', + RUNNER_OS: 'windows', + RUNNER_TEMP: 'C:\\runner-temp' + }, 'win32')); }); test('installer phases cover current user then all users with scope-correct paths', () => { diff --git a/scripts/smoke-test-managed-tools-live.js b/scripts/smoke-test-managed-tools-live.js index 1ed4b2a..a522ba4 100644 --- a/scripts/smoke-test-managed-tools-live.js +++ b/scripts/smoke-test-managed-tools-live.js @@ -8,7 +8,8 @@ function assertActionsWindowsCi(environment = process.env, platform = process.pl const serverUrl = String(environment.GITHUB_SERVER_URL || '').replace(/\/+$/, '').toLowerCase(); const isGitHubActions = environment.GITHUB_ACTIONS === 'true' && environment.GITEA_ACTIONS !== 'true' && environment.RUNNER_ENVIRONMENT === 'github-hosted' && serverUrl === 'https://github.com'; const isGiteaActions = environment.GITEA_ACTIONS === 'true' && serverUrl === 'https://git.24-music.de'; - if (platform !== 'win32' || environment.CI !== 'true' || environment.RUNNER_OS !== 'Windows' || !environment.RUNNER_TEMP || !environment.GITHUB_RUN_ID || (!isGitHubActions && !isGiteaActions)) { + const runnerOs = String(environment.RUNNER_OS || '').toLowerCase(); + if (platform !== 'win32' || environment.CI !== 'true' || runnerOs !== 'windows' || !environment.RUNNER_TEMP || !environment.GITHUB_RUN_ID || (!isGitHubActions && !isGiteaActions)) { throw new Error('Live managed-tool smoke is restricted to an approved Windows Actions runner'); } } diff --git a/scripts/smoke-test-managed-tools-live.test.js b/scripts/smoke-test-managed-tools-live.test.js index 71931f6..cc654a2 100644 --- a/scripts/smoke-test-managed-tools-live.test.js +++ b/scripts/smoke-test-managed-tools-live.test.js @@ -14,6 +14,7 @@ const { test('accepts GitHub and Gitea Windows Actions while rejecting local opt-in', () => { assert.doesNotThrow(() => assertActionsWindowsCi({ CI: 'true', GITHUB_ACTIONS: 'true', GITHUB_SERVER_URL: 'https://github.com', RUNNER_ENVIRONMENT: 'github-hosted', RUNNER_OS: 'Windows', RUNNER_TEMP: 'C:\\runner-temp', GITHUB_RUN_ID: '123' }, 'win32')); assert.doesNotThrow(() => assertActionsWindowsCi({ CI: 'true', GITEA_ACTIONS: 'true', GITHUB_SERVER_URL: 'https://git.24-music.de', RUNNER_OS: 'Windows', RUNNER_TEMP: 'C:\\runner-temp', GITHUB_RUN_ID: '456' }, 'win32')); + assert.doesNotThrow(() => assertActionsWindowsCi({ CI: 'true', GITEA_ACTIONS: 'true', GITHUB_SERVER_URL: 'https://git.24-music.de', RUNNER_OS: 'windows', RUNNER_TEMP: 'C:\\runner-temp', GITHUB_RUN_ID: '456' }, 'win32')); assert.throws(() => assertActionsWindowsCi({ CI: 'true', RUNNER_OS: 'Windows' }, 'win32'), /Windows Actions runner/); assert.throws(() => assertActionsWindowsCi({ TWITCH_VOD_MANAGER_MANAGED_TOOLS_LIVE: '1' }, 'win32'), /Windows Actions runner/); assert.throws(() => assertActionsWindowsCi({ CI: 'true', GITHUB_ACTIONS: 'true', GITHUB_SERVER_URL: 'https://ci.example.test', RUNNER_ENVIRONMENT: 'github-hosted', RUNNER_OS: 'Windows', RUNNER_TEMP: 'C:\\runner-temp', GITHUB_RUN_ID: '123' }, 'win32'), /Windows Actions runner/);