fix(ci): accept the lowercase RUNNER_OS reported by Gitea act runners
Windows CI / verify (push) Failing after 4m30s

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.
This commit is contained in:
Sucukdeluxe
2026-08-14 15:21:14 +02:00
parent 70124a9570
commit 5f88897c75
4 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -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');
}
}
+8
View File
@@ -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', () => {
+2 -1
View File
@@ -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');
}
}
@@ -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/);