Repository navigation
Description
Why
deploy-cloudflare (#163, PR #176) publishes a built site to an existing Cloudflare Worker, but it only supports private sites behind Cloudflare Access. From the name, you would expect it to handle both private and public sites. Right now the only way to deploy a public site is awkward and unsafe:
require-access: falseskips every gate check. It also prints "Never use this for private content" on every run, and the job summary marks every URL "⚠️ not checked". Nothing verifies what was actually published.team-domainis still required, and must look like<team>.cloudflareaccess.com. A public site has to pass a dummy value.- One boolean turns off every check, which makes it too easy to publish a private build by mistake.
The rest of the action already works for a public site: the pinned wrangler, the generated config, the alias, and the job summary.
Proposal
Replace require-access with an explicit declaration that is checked in both directions:
| Input | Purpose |
|---|---|
visibility (required, no default) |
private or public. Leaving it out, or any other value, fails validation, so every workflow states its audience at the call site and a typo never reads as "off" |
team-domain |
Required when private. An error when public: see the cross-check below |
privatebehaves exactly asrequire-access: truedoes today. The gate is checked before uploading, after deploying (production and the new version's preview URL), and after the alias upload.publicflips the checks instead of skipping them. At the same three points, an anonymous request must be served the site, with no redirect to any*.cloudflareaccess.com. A Worker declared public but actually gated then fails too, so a mix-up between the two fails in either direction.
Updated 2026-09-23: visibility is required with no default, rather than defaulting to private. Intent is then explicit in every workflow: it is as clear to a reviewer as a uses: line, and as searchable (grep 'visibility: public'). Nothing is left implicit for a copied workflow to carry over unnoticed.
Cross-checking the inputs
Validation rejects the combinations that only a workflow copied from the other kind of site would produce:
visibility |
team-domain |
Result |
|---|---|---|
private |
set | ✅ |
private |
empty | ❌ "visibility is private, so team-domain is required" |
public |
empty | ✅ |
public |
set | ❌ "team-domain is set, but visibility is public — did you mean private?" |
| missing or other | any | ❌ "visibility must be private or public" |
Saying the mode loudly
The first line of the log and the heading of the job summary name the mode:
PRIVATE site, gated by <team>.cloudflareaccess.comPUBLIC site, served anonymously
A reader of the run never has to work out which one it was.
Why one action, not two
This was considered: for example deploy-cloudflare for private sites and a separate action for public ones. The config does not make a site public or private; the Worker's Access setting in the Cloudflare dashboard does. The action declares the expected audience and checks the live site against it. Two actions would change where that declaration is written, not what is enforced.
With visibility required, the input carries the same benefit a separate uses: line would: intent is explicit at the call site and searchable across the org. It avoids the costs of splitting:
- Validation, install, config, deploy, alias and summary would be duplicated, or pulled into shared scripts.
- A sibling composite call (
…/deploy-cloudflare@v0from inside another action) cannot be tested before a release. That is the same limitbuild-jupyter-cachealready has; see TESTING.md. - Two READMEs would need to stay in sync.
- A copy-paste mistake would still be one line.
Revisit this only if the audience ever needs to be governed at the action level, for example restricting who may use the public variant.
Open questions
- What counts as "served the site". The obvious answer is a
2xxon the auto-picked non-HTML file and on/. A build withoutindex.htmlanswers404at the root, so the root check may need to accept that, or rely on the file alone. - Whether the public pre-deploy check is needed. For private sites it prevents an upload. For public sites it would mainly catch a Worker that is unexpectedly gated or missing. The deploy token cannot create a Worker, so a missing Worker still fails at
wrangler deploy. check-access-gate.sh: add an--expect-publicmode, or keep that logic in a separate script. The harness fixture (.github/fixtures/access-gate/server.py) already serves both a/publicand a/gatedresponse.- Custom domains. Public sites are more likely to want one. Revisit whether the action should take a
custom-domaininput; deploy-cloudflare: publish private sites to a Cloudflare Worker behind Access, and prove they are gated #163 left domains to the dashboard. - Where this sits against the rest. GitHub Pages (
publish-gh-pages) is still the default for public production sites, per deploy-cloudflare: publish private sites to a Cloudflare Worker behind Access, and prove they are gated #163. Public PR previews on Workers are Add Workers static assets support to the Cloudflare preview action #145's job, and it may reuse this action's wrangler install and config.
Sequencing
Start after PR #176 merges. Ideally this lands before the next release, so require-access never ships to consumers and making visibility required breaks nobody. If a release goes out first, making visibility required is a require-access. In that case, keep require-access as a deprecated alias for one release, mapping true to private with a warning to add visibility, and say so in the CHANGELOG.
Checklist
-
visibilityinput: required,privateorpublic, no default - Input cross-check:
team-domainrequired forprivate, rejected forpublic, with the messages above - Public mode in the gate check, with before-deploy, after-deploy and alias checks inverted
- Mode named in the first log line and the job summary heading; summary rows for public sites (for example "✅ public, served anonymously")
- Harness: public-mode cases in
dc-gate-probe;dc-inputscases for a missingvisibilityand each rejected combination; a public-mode case indc-refuses-ungatedfor a Worker that is unexpectedly gated - README (usage for both modes, inputs, what each mode proves, troubleshooting), CHANGELOG, QUICK-REFERENCE
Activity
mmcky commentedon Nov 4, 2026
Decided 2026-11-04.⚠️ CHANGELOG entry at that point. The chapter to update is
require-accessshipped in v0.12.0, sovisibilityarrives withrequire-accesskept as a deprecated alias for one release:truemaps toprivate, with a warning telling callers to switch tovisibility. The alias is removed in the release after, with adocs/user/actions/deploy-cloudflare.md; the README is generated and QUICK-REFERENCE is gone.Posted by Claude Code (on behalf of mmcky), from the 2026-11-04 decision session.
feat(deploy-cloudflare): a visibility input, private or public, check…
feat(deploy-cloudflare): a visibility input, private or public, check…
feat(deploy-cloudflare): a visibility input, private or public, check…
feat(deploy-cloudflare): a visibility input, private or public, check…
docs(changelog): require-access removed, visibility required (#177)
fix(deploy-cloudflare): say only "remove it" when require-access sits…
fix(deploy-cloudflare): remove require-access, and require visibility (…
release: v0.16.0 (#278)