Skip to content

Broken Netlify CMS due to Github master branch name change to "main" #4417

@jsl15c

Description

@jsl15c

When a branch is not specified in config.yml, Netlify defaults to using master branch of repo. Due to recent name change of master branch to main , this creates an API_ERROR: cannot find branch in CMS when publishing entries and 404 errors on initial CMS load.

To Reproduce

  1. Create a new repo and project utilizing Netlify CMS, netlify-cms-app . I used gatsby.js for my project.
  2. Setup config.yml in project without specifying branch name under:
backend:
  name: github
  repo: org/repo
  1. Publish a new entry in Netlify CMS

Expected behavior
Initial load of localhost:8000/admin results in 404 (that are handled well). Main problem is introduced when publishing CMS entries. API_ERROR occurs.

Applicable Versions:

  • Netlify CMS version: 2.12.25
  • Git provider: Github
  • Node.JS version: 13.13.0

CMS configuration

backend:
  name: github
  repo: jsl15c/repo
media_folder: static/assets
public_folder: /static
collections:
  - name: Product
    label: Product
    folder: product
    create: true
    fields:
      - { name: name, label: Name }
      - { label: Description, name: description, widget: text }
      - { label: Price, name: price, widget: number }

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docstype: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions