add back authorization header for github api (#3529)

This commit is contained in:
Shu Ding
2020-01-09 22:58:33 +08:00
committed by GitHub
parent 4dd640636c
commit 7e584be2cd
2 changed files with 6 additions and 0 deletions

View File

@@ -10,6 +10,9 @@ export async function getGitHubRepoInfo(repo: Repo) {
const response = await fetch(`https://api.github.com/repos/${repo.repo}`, { const response = await fetch(`https://api.github.com/repos/${repo.repo}`, {
headers: { headers: {
Accept: 'application/vnd.github.machine-man-preview+json', Accept: 'application/vnd.github.machine-man-preview+json',
// If we don't use a personal access token,
// it will get rate limited very easily.
Authorization: `Bearer ${process.env.GITHUB_ACCESS_TOKEN}`
}, },
}); });

View File

@@ -6,6 +6,9 @@
"statusCode": 307 "statusCode": 307
} }
], ],
"env": {
"GITHUB_ACCESS_TOKEN": "@now-api-examples-github-token"
},
"headers": [ "headers": [
{ {
"source": "/api/frameworks", "source": "/api/frameworks",