Cannot change production branches

The default branch of production deployment is master, but github uses main branch by default, so I cannot deploy to production.

Branch build controls · Cloudflare Pages docs

Is this document outdated? I cannot find these options: Pages project > Settings > Builds & deployments > Configure Production deployments .

Sadly, this a long-standing issue for Direct Upload projects that still hasn’t been resolved, despite being reported as far back as mid-2022.

Here’s a wrangler issue about it: Feature Request: ability to change production branch of Direct Upload Pages project · Issue #1852 · cloudflare/workers-sdk · GitHub
And a pages action issue: No way to define if production or preview env · Issue #63 · cloudflare/pages-action · GitHub

You can update it via the API if you need, since it doesn’t appear that this is an issue being prioritized:

curl -X PATCH "https://api.cloudflare.com/client/v4/accounts/<account id>/pages/projects/<project name>" \
     -H "Authroization: Bearer <api token>" \
     -H "Content-Type: application/json" \
     --data '{"production_branch": "main"}'
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.