decaporg / decaporg/decap-cms

GET request to GitHub specifies "repositories" instead of "repos" in the path

Open
#5,687 1 comment 0 reactions 0 assignees View on GitHub
area: extensions/backends/github type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
Trying out Netflify CMS using the index.html demo page. Admin UI loads without issue but publishing content results in a 404 in the browser console

`GET https://api.github.com/repositories/tforster/netlify-poc/branches/main 404`

cURLing that endpoint also produces a 404. According to the GitHub docs repositories should be repos. cURLing the corrected URL returns the expected JSON response.

``` bash
# Using /repos/ in the path works
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/tforster/netlify-poc/branches/main
```

**To Reproduce**

Either navigate in a browser to the URL that Netflify CMS was trying to reach `https://api.github.com/repositories/tforster/netlify-poc/branches/main`

or try the following

``` bash
# Using /repositories/ in the path fails with a 404
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/tforster/netlify-poc/branches/main
```

**Applicable Versions:**
Have used both the following script references, all produce the same erroneous behaviour

- https://cdn.jsdelivr.net/npm/netlify-cms@2.10.153/dist/netlify-cms.js
- https://cdn.jsdelivr.net/npm/netlify-cms@^2.0.0/dist/netlify-cms.js
- https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js

**CMS configuration**

``` yaml
backend:
name: github
repo: tforster/netlify-poc
api_root: https://api.github.com
site_domain: cms.netlify.com
base_url: https://api.netlify.com
auth_endpoint: auth

media_folder: static/img
public_folder: /img

collections:

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.