Unverified Commit 04d41f04 authored by Jun's avatar Jun Committed by GitHub

Merge pull request #4 from danithecake/private-repos-support

Support for private Github repositories
parents d2a46083 3348f584
...@@ -3,7 +3,8 @@ export const base = 'https://api.github.com' ...@@ -3,7 +3,8 @@ export const base = 'https://api.github.com'
export const getContent = (filePath, githubData) => { export const getContent = (filePath, githubData) => {
return fetch(`${base}/repos/${githubData.owner}/${githubData.name}/contents/${filePath}`, { return fetch(`${base}/repos/${githubData.owner}/${githubData.name}/contents/${filePath}`, {
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json',
'Authorization': `token ${githubData.githubToken}`
} }
}) })
.then(response => response.json()) .then(response => response.json())
...@@ -17,7 +18,8 @@ export const getContent = (filePath, githubData) => { ...@@ -17,7 +18,8 @@ export const getContent = (filePath, githubData) => {
export const getCommit = (githubData) => { export const getCommit = (githubData) => {
return fetch(`${base}/repos/${githubData.owner}/${githubData.name}/commits/refs/heads/master`, { return fetch(`${base}/repos/${githubData.owner}/${githubData.name}/commits/refs/heads/master`, {
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json',
'Authorization': `token ${githubData.githubToken}`
} }
}) })
.then(response => response.json()) .then(response => response.json())
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment