ci: use dedicated CF_PURGE_TOKEN for edge purge; skip quietly if unset#7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The shared
CLOUDFLARE_API_TOKENhas R2 +Zone:Readbut notZone.Cache-Purge, so the purge step (added in #6) returned 401 and emitted a warning on every publish.Cache purge is optional anyway:
no-storeon the metadata (set in the upload step) already guarantees the edge never serves a stale index. So:CF_PURGE_TOKENsecret is set → purge actively (warn only if that token fails).To enable autonomous purge (optional)
Create a Cloudflare API token scoped to Zone.Cache-Purge on the
wheels.devzone and add it as theCF_PURGE_TOKENsecret in this repo. Until then,no-storekeeps every publish fresh on its own.Refs: wheels-dev/wheels#3218