Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/site-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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</span>" "$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.
Expand Down