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/);