Skip to content

fix: add CLOUDFLARE_ACCOUNT_ID to deploy workflow#158

Merged
mahata merged 1 commit intomainfrom
opencode/witty-lagoon
Mar 30, 2026
Merged

fix: add CLOUDFLARE_ACCOUNT_ID to deploy workflow#158
mahata merged 1 commit intomainfrom
opencode/witty-lagoon

Conversation

@mahata
Copy link
Copy Markdown
Owner

@mahata mahata commented Mar 30, 2026

Summary

  • Add CLOUDFLARE_ACCOUNT_ID env var to the deploy job steps so Wrangler skips the /memberships API call that was failing with authentication error
  • Update README to recommend the "Edit Cloudflare Workers" API token template (which includes all required permissions) and document both required secrets (CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID)

Root Cause

Wrangler calls the Cloudflare /memberships API to discover the account to deploy to. This requires the User Memberships Read permission. Passing CLOUDFLARE_ACCOUNT_ID as an environment variable bypasses this lookup entirely — which is the approach recommended by Cloudflare's GitHub Actions deployment docs.

Wrangler calls the /memberships API to discover the account, which
requires User Memberships Read permission. Adding CLOUDFLARE_ACCOUNT_ID
skips this lookup entirely. Also update README to recommend the
'Edit Cloudflare Workers' template and document both required secrets.
Copilot AI review requested due to automatic review settings March 30, 2026 01:40
@mahata mahata merged commit af0ce3f into main Mar 30, 2026
6 checks passed
@mahata mahata deleted the opencode/witty-lagoon branch March 30, 2026 01:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the production deployment pipeline to pass Cloudflare’s account ID explicitly to Wrangler, avoiding a failing account-discovery API call, and updates the README to document the additional required secret.

Changes:

  • Add CLOUDFLARE_ACCOUNT_ID to the deploy workflow steps that run Wrangler (migrations + deploy).
  • Update README CI/CD docs to require both CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID, and recommend a Cloudflare API token template/permissions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Documents the two required GitHub secrets for deploy and recommends the appropriate Cloudflare API token setup.
.github/workflows/deploy.yml Passes CLOUDFLARE_ACCOUNT_ID to Wrangler-invoking steps to prevent failing account lookup.

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.

2 participants