Skip to content

chore(ci): rotate the Cloudflare API token the Smoke lane publishes with #386

Closed

Description

@sydevs-bot

Summary

Every pull request in this repository has failed the required Smoke check since 2026-11-10 18:29Z. Cloudflare rejects CLOUDFLARE_API_TOKEN with Invalid access token [code: 9109], so the preview is never published and no smoke spec runs. No branch's diff is the cause, and no automated run can fix it — replacing an Actions secret needs a human.

Approach

  • .github/workflows/ci.yml:212 — the Publish the preview step runs wrangler versions upload --config wrangler.jsonc --preview-alias pr-<n> through cloudflare/wrangler-action, authenticating with secrets.CLOUDFLARE_API_TOKEN and secrets.CLOUDFLARE_ACCOUNT_ID (ci.yml:217-220).
  • The secret is set. ci.yml:140's HAS_SECRETS guard passed and the lane reported REASON: publish, not no-credentials. Cloudflare answers /accounts with Invalid access token [code: 9109] and /accounts/***/workers/services/sahajatlas-web with Authentication error [code: 10000]. Both are token-level: expired, revoked, or no longer scoped to Workers.
  • Mint a replacement Cloudflare API token with Workers Scripts edit permission on the account CLOUDFLARE_ACCOUNT_ID names, and set it as CLOUDFLARE_API_TOKEN in this repository's Actions secrets. Confirm CLOUDFLARE_ACCOUNT_ID still matches that account.
  • No code change belongs in this ticket.

Acceptance criteria

  • On a same-repo pull request, the Publish the preview step returns a preview address instead of code: 9109.
  • Smoke concludes success on an open pull request whose diff touches no CI file.
  • .github/workflows/ci.yml is unchanged.

Verification checklist

  • Re-run Smoke on an open pull request and read the Publish the preview step for the Cloudflare error codes.
  • gh api repos/sydevs/SahajAtlasWeb/actions/workflows/ci.yml/runs --jq '.workflow_runs[0].conclusion' returns success.

Notes

  • Last green run: 42870487851, 2026-11-10T17:59Z. First failure: 42875675827, 18:29Z. Every run since has failed identically, on human branches as well as bot ones — chore/pin-playwright-mcp, run 42923603741.
  • Do not weaken the gate to clear this. The lane fails hard rather than report a green check that read nothing, and the step's own comment names chore(build): make preview discovery survive a slow cloudflare deploy #132's "just re-run it" habit as the reason. Re-running repeats the upload and fails the same way.
  • Workers Builds: sahajatlas-design stays green because Cloudflare's Git integration holds a separate credential.
  • Found by fix-ci on chore(contracts): re-sync copied contracts from SahajCloud #384, which spent its three ciFixIterations passes on this and pushed nothing.

Activity

  1. added theissue type on Nov 11, 2026
  2. added
    proposal
    on Nov 11, 2026
  3. Ardnived commented on Nov 11, 2026

    @Ardnived
    Contributor

    Resolved by updating the secret. No code change.

    Cause. The Cloudflare token was rolled on 2026-11-10, when Workers Scripts: Edit was added to it. Rolling a token invalidates its old value at once, but the new value didn't reach GitHub. The secret is org-level (sydevs → Settings → Secrets and variables → Actions), not a repository secret as the ticket assumed, and it still showed updated_at 2026-10-16. The failures started at 18:29Z that day.

    Fix. The rolled value was saved to the org secret CLOUDFLARE_API_TOKEN on 2026-11-11 at 17:03Z.

    Verification.

    Follow-up. SahajCloud's preview-asset cleanup now reads the same org secret, in sydevs/SahajCloud#1111. That makes the token shared: a future rotation must update the org secret, and a re-scope must keep Workers Scripts (Edit) for this repo and Images (Edit), Stream (Edit) and R2 Object Read & Write for SahajCloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal

    Type

    Fields

    Priority

    High

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions