From 2aef9c2b5b87898a2558dd834bc3faea23ff6b2c Mon Sep 17 00:00:00 2001 From: GodsQuantum <193283917+GodsQuantum@users.noreply.github.com> Date: Wed, 18 Nov 2026 23:38:18 +0100 Subject: [PATCH] fix(site): diagnose release version mismatch before static publish --- .github/workflows/site-pages.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/site-pages.yml b/.github/workflows/site-pages.yml index e6140a5..6380dc3 100644 --- a/.github/workflows/site-pages.yml +++ b/.github/workflows/site-pages.yml @@ -51,9 +51,23 @@ jobs: # The static fallback must match the current app even when the # latest-release API cannot be reached by the visitor. expected="$(node -p "require('./frontend/package.json').version")" - for locale in fr en zh-CN; do - grep -Fq "id=\"release-tag\">v$expected" "$target/$locale/index.html" - done + # Assert the deployed file actually contains the version generated + # from this tagged application. Include diagnostics on failure. + node - "$target" "$expected" <<'JS' + const fs = require('node:fs'); + const path = require('node:path'); + const [root, version] = process.argv.slice(2); + for (const locale of ['fr', 'en', 'zh-CN']) { + const file = path.join(root, locale, 'index.html'); + const html = fs.readFileSync(file, 'utf8'); + const actual = html.match(/id="release-tag">([^<]+)<\/span>/)?.[1]; + console.log('Deployed static release version:', locale, actual); + if (actual !== 'v' + version) { + console.error('Static release mismatch:', {locale, actual, expected: 'v' + version}); + process.exitCode = 1; + } + } + JS git -C "$target" add -A # Explicitly include localized pages; never silently accept an # untracked or globally ignored release-version update.