Skip to content

ci: use dedicated CF_PURGE_TOKEN for edge purge; skip quietly if unset#7

Merged
bpamiri merged 1 commit into
mainfrom
peter/cf-purge-token
Jun 19, 2026
Merged

ci: use dedicated CF_PURGE_TOKEN for edge purge; skip quietly if unset#7
bpamiri merged 1 commit into
mainfrom
peter/cf-purge-token

Conversation

@bpamiri

@bpamiri bpamiri commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

The shared CLOUDFLARE_API_TOKEN has R2 + Zone:Read but not Zone.Cache-Purge, so the purge step (added in #6) returned 401 and emitted a warning on every publish.

Cache purge is optional anyway: no-store on the metadata (set in the upload step) already guarantees the edge never serves a stale index. So:

  • If a dedicated CF_PURGE_TOKEN secret is set → purge actively (warn only if that token fails).
  • If it is unset → skip with a one-line info, no more 401 warning on every publish.

To enable autonomous purge (optional)

Create a Cloudflare API token scoped to Zone.Cache-Purge on the wheels.dev zone and add it as the CF_PURGE_TOKEN secret in this repo. Until then, no-store keeps every publish fresh on its own.

Refs: wheels-dev/wheels#3218

The shared CLOUDFLARE_API_TOKEN has R2 + Zone:Read but not Zone.Cache-Purge, so
the purge step returned 401 and emitted a warning on every publish. Cache purge
is optional anyway — `no-store` on the metadata (upload step) already keeps the
edge from ever serving a stale index. Switch the purge to a dedicated
CF_PURGE_TOKEN secret: if it's set, purge actively (and warn only if that token
itself fails); if it's unset, skip with a one-line info instead of a 401 warning.

To enable autonomous purge: create a Cloudflare API token scoped to
Zone.Cache-Purge on the wheels.dev zone and add it as the CF_PURGE_TOKEN secret.

Refs: wheels-dev/wheels#3218

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri bpamiri merged commit 72c9610 into main Jun 19, 2026
@bpamiri bpamiri deleted the peter/cf-purge-token branch June 19, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant