1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 09:05:22 -04:00

secret can't be named GITHUB_TOKEN

This commit is contained in:
Jake Jarvis 2021-06-03 09:39:53 -04:00
parent 9505767f3d
commit e68aec80c7
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
2 changed files with 4 additions and 2 deletions

View File

@ -13,3 +13,5 @@ WEBMENTIONS_TOKEN=
FAUNADB_ADMIN_SECRET=
FAUNADB_SERVER_SECRET=
GH_PUBLIC_TOKEN=

View File

@ -10,7 +10,7 @@ const username = "jakejarvis";
async function fetchRepos(sort, limit) {
const client = new GraphQLClient("https://api.github.com/graphql", {
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
Authorization: `Bearer ${process.env.GH_PUBLIC_TOKEN}`,
Accept: "application/vnd.github.v3+json",
},
});
@ -77,7 +77,7 @@ exports.handler = async (event) => {
if (event.httpMethod !== "GET") {
throw new Error(`Method ${event.httpMethod} not allowed.`);
}
if (!process.env.GITHUB_TOKEN) {
if (!process.env.GH_PUBLIC_TOKEN) {
throw new Error("GitHub API credentials aren't set.");
}