fix · unni-web

Fix: Direct Uploads Pages project cannot connect to GitHub

Error / Symptom

Patching a Pages project to add a GitHub source returned HTTP 400:

PATCH /accounts/<account>/pages/projects/unni-home
{
  "errors": [
    {
      "code": 8000069,
      "message": "You cannot update the `source` object in a Direct Uploads project."
    }
  ]
}

Cause

A Pages project created for Direct Uploads has no Git source. Cloudflare does not allow converting it to a Git-connected project after creation.

Remedy

Choose one:

  • If the project has no live traffic: delete and recreate it with the source set at creation. We did this for unni-home, unni-addons, unni-tools and unni-research while they had no deployments.
  • If the project is live and its URL matters: keep it and deploy to it from CI. For unni-games we used a GitHub Actions workflow with cloudflare/wrangler-action and two repo secrets:
gh secret set CLOUDFLARE_API_TOKEN
gh secret set CLOUDFLARE_ACCOUNT_ID --body <account-id>
gh workflow run deploy-games.yml --ref main
  • If you have the CLI logged in: deploy directly instead.
cf auth login
cf pages deployments create unni-games --pages-build-output-dir sites/games/dist

Recurrence notes

  • Test the source connection with a throwaway project before deleting anything.
  • Deleting a live project risks losing its pages.dev name. For unni-games that would break 57 game URLs, so we did not do it.
  • A Direct Uploads project can still receive deployments from CI. “No Git source” does not mean “no automation”.