Repository navigation
ci(cleanup): read the Cloudflare token from the org-level CLOUDFLARE_API_TOKEN - #1111
Merged
Merged
Conversation
…API_TOKEN The nightly preview-asset cleanup read the repo-level `CLOUDFLARE_API_KEY` secret while `CLOUDFLARE_ACCOUNT_ID` already came from the org. It now reads the org-level `CLOUDFLARE_API_TOKEN` that SahajAtlasWeb's Smoke lane uses, so one rotation updates both repos. The script and Railway keep the `CLOUDFLARE_API_KEY` name, so only the workflow's mapping changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1111 environment in sahajcloud
1 service not affected by this PR
|
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-1111
November 11, 2026 17:11
Destroyed
Closed
5 tasks
sydevs-bot
pushed a commit
that referenced
this pull request
Nov 11, 2026
`Register the preview's fixed address` failed on this PR's own head:
CloudflareError: Cloudflare PUT /accounts/***/storage/kv/namespaces/
9c43446be07544ae933284c8967b5d20/values/pr-1082: HTTP 401 — 10000:
Authentication error
The step read `secrets.CLOUDFLARE_API_KEY`, which is the name of the
environment variable the scripts and Railway use, not the name of the
GitHub secret holding the account's API token. #1111 moved the nightly
cleanup off that repo-level secret and onto the org-level
`CLOUDFLARE_API_TOKEN` for the same reason; both steps added here were
written before it and kept the old name.
The sweep step shadowed the job's Cloudflare pair with its own copy, so
merging #1111 left one file handing `scripts/preview-domain.ts` two
different credentials depending on which step invoked it. The copy is
deleted rather than corrected — it is the drift that the job-level
values exist to prevent.
This fixes which token is sent. Whether that token carries Workers KV
Storage:Edit, Workers Scripts:Edit, Zone:Read and the zone's Workers
Routes:Edit is still step 0's, and the check stays red until it does.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWoSjeryJXkLhfAYYL
This was referenced Nov 11, 2026
This branch was successfully deployed
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.
Summary
The nightly preview-asset cleanup read its token from the repo-level
CLOUDFLARE_API_KEYsecret, whileCLOUDFLARE_ACCOUNT_IDalready came from the org. It now reads the org-levelCLOUDFLARE_API_TOKEN, the same secret SahajAtlasWeb's Smoke lane publishes with, so one rotation updates both repos..github/workflows/cleanup-preview-assets.yml:CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_TOKEN }}. The script and Railway keep theCLOUDFLARE_API_KEYname, so no app code or Railway variable changes.docs/rules/storage.md: the config table lists both values as org secrets. ⚠ It now records that the token is shared: a rotation must update the org secret, and a re-scope must keep Images (Edit), Stream (Edit), and R2 Object Read & Write for this repo and Workers Scripts (Edit) for SahajAtlasWeb.Verification
Dry-run dispatch on this branch at
d9adf4e1(apply=false, deletes nothing): run 43065427738 succeeded. All three backends authenticated with the org token, including R2's S3 credentials, which are derived from the token. The scan counts match this morning's scheduled run on the old secret:After merge
CLOUDFLARE_API_KEYActions secret. Nothing reads it any more.Related: sydevs/SahajAtlasWeb#386
🤖 Generated with Claude Code