diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5346c2c7..b87d4a60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,6 +253,17 @@ jobs: --changed-file artifacts/dist-purge-targets.txt \ --base-url "$CLOUDFLARE_PURGE_BASE_URL" + - name: Verify deployed index.html version markup + env: + CLOUDFLARE_PURGE_BASE_URL: ${{ secrets.CLOUDFLARE_PURGE_BASE_URL }} + run: | + if [ -z "$CLOUDFLARE_PURGE_BASE_URL" ]; then + echo "CLOUDFLARE_PURGE_BASE_URL is required to verify deployed index.html" + exit 1 + fi + + DEPLOY_INDEX_URL="${CLOUDFLARE_PURGE_BASE_URL%/}/index.html" npm run verify:deployed:index-html + unit-tests: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/package.json b/package.json index 91c55b2a..0889d107 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "hash:dist": "node scripts/hash-dist.mjs --dist dist --output artifacts/dist-hashes-current.json", "diff:dist-hashes": "node scripts/diff-dist-hashes.mjs", "verify:dist:deploy-artifact": "node scripts/verify-dist-deploy-artifact.mjs", + "verify:deployed:index-html": "node scripts/verify-deployed-index-html.mjs", "purge:cloudflare:changed": "node scripts/purge-cloudflare-changed.mjs", "smoke:dist-assets": "node scripts/check-asset-references.mjs", "test:e2e:cache-upgrade": "npx playwright test tests/e2e/cache-upgrade-smoke.spec.ts --project=e2e" diff --git a/scripts/verify-deployed-index-html.mjs b/scripts/verify-deployed-index-html.mjs new file mode 100644 index 00000000..36bcf5b2 --- /dev/null +++ b/scripts/verify-deployed-index-html.mjs @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +const VERSION_MARKUP_PATTERN = /seed\.\s*zap\.\s*subscribe\.\s*<\/h2>\s*