Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 14 additions & 8 deletions .github/workflows/deploy-cloudflare-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,27 @@ jobs:
"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/secure-tools-web-bridge" \
--header "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}")"

jq --raw-output '
.result as $project |
"Pages project state: name=\($project.name), production_branch=\($project.production_branch), subdomain=\($project.subdomain), custom_domain_count=\($project.domains // [] | map(select(. != $project.subdomain)) | length), source=\(if $project.source == null then "direct-upload" else $project.source.type end), web_analytics=\(if ($project.build_config.web_analytics_tag // "") == "" and ($project.build_config.web_analytics_token // "") == "" then "disabled" else "enabled" end)"
' <<< "$project"

jq --exit-status '
.result as $project |
.success == true and
.result.name == "secure-tools-web-bridge" and
.result.production_branch == "main" and
.result.subdomain == "secure-tools-web-bridge.pages.dev" and
(.result.domains | length) == 0 and
.result.source == null and
(.result.build_config.web_analytics_tag // "") == "" and
(.result.build_config.web_analytics_token // "") == ""
$project.name == "secure-tools-web-bridge" and
$project.production_branch == "main" and
$project.subdomain == "secure-tools-web-bridge.pages.dev" and
($project.domains // [] | map(select(. != $project.subdomain)) | length) == 0 and
$project.source == null and
($project.build_config.web_analytics_tag // "") == "" and
($project.build_config.web_analytics_token // "") == ""
' <<< "$project" > /dev/null || {
echo "::error::Cloudflare Pages project is missing or violates the H3.2 isolation contract"
exit 1
}

echo "Validated Direct Upload project secure-tools-web-bridge: production branch main, zero custom domains, no Git integration, no Web Analytics."
echo "Validated Direct Upload project secure-tools-web-bridge: production branch main, stable pages.dev subdomain only, zero custom domains, no Git integration, no Web Analytics."

- name: Deploy to Cloudflare Pages
id: deploy
Expand Down
5 changes: 3 additions & 2 deletions tests/cloudflare-bridge.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ assert.match(workflow, /X-Robots-Tag: noindex, nofollow/);
assert.match(workflow, /steps\.deploy\.outputs\.deployment-url/);
assert.match(workflow, /--max-redirs 0/);
assert.match(workflow, /api\.cloudflare\.com\/client\/v4\/accounts\/\$\{CLOUDFLARE_ACCOUNT_ID\}\/pages\/projects\/secure-tools-web-bridge/);
assert.match(workflow, /\(\.result\.domains \| length\) == 0/);
assert.match(workflow, /\.result\.source == null/);
assert.match(workflow, /\$project\.domains \/\/ \[\] \| map\(select\(\. != \$project\.subdomain\)\) \| length/);
assert.match(workflow, /\$project\.source == null/);
assert.match(workflow, /web_analytics_tag/);
assert.match(workflow, /web_analytics_token/);
assert.match(workflow, /Pages project state:/);
assert.match(workflow, /\[\[ ! -e "\$BRIDGE_DIRECTORY\/CNAME" \]\]/);
assert.match(workflow, /\[\[ ! -e "\$BRIDGE_DIRECTORY\/_redirects" \]\]/);
assert.doesNotMatch(workflow, /tools\.securetools\.app/);
Expand Down
Loading