Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect branch name with GitHub backend #1933

Closed
KarthikBhaskara opened this issue Dec 4, 2018 · 4 comments · Fixed by #2878
Closed

Incorrect branch name with GitHub backend #1933

KarthikBhaskara opened this issue Dec 4, 2018 · 4 comments · Fixed by #2878
Labels

Comments

@KarthikBhaskara
Copy link

Describe the bug
According to the docs, if my backend is Github, the branch name created from the CMS should be of the form cms/collectionName-slug, however, when I push from the CMS, the branch name is of the form cms/slug. This creates issues when I am modifying multiple pages of the same name from different directories, for example, a/intro/ and b/intro/.

Applicable Versions:

  • Netlify CMS version: 2.1.3
  • Git provider: GitHub

CMS configuration

backend:
  name: github
  repo: random/repo
  squash_merges: true

publish_mode: editorial_workflow

media_folder: static/assets
public_folder: /assets

collections:
  - name: a
    label: a
    folder: content/a
    slug: "{{slug}}"
    create: true
    fields:
      - { name: title, label: Title }
      - { name: body, label: Body, widget: markdown }
  - name: b
    label: b
    folder: content/integration-guides/b
    slug: "{{slug}}"
    create: true
    fields:
      - { name: title, label: Title }
      - { name: body, label: Body, widget: markdown }
@barthc
Copy link
Contributor

barthc commented Dec 5, 2018

@erquhart, as it is the github backend is not using the collectionName as part of the branch and metakey names. Fixing this will introduce a breaking change, thoughts?

@erquhart
Copy link
Contributor

erquhart commented Dec 5, 2018

Curious whether it was ever using the collection name. We may need to start writing with the collection name but reading for both.

Sent with GitHawk

@KarthikBhaskara
Copy link
Author

@erquhart @barthc I took a shot at this and put up a PR to fix this while maintaining backwards compatibility to avoid the necessity of a breaking change 👉 #1944.

Let me know what your thoughts are!

@stale
Copy link

stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants