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:
parent
9505767f3d
commit
e68aec80c7
@ -13,3 +13,5 @@ WEBMENTIONS_TOKEN=
|
|||||||
|
|
||||||
FAUNADB_ADMIN_SECRET=
|
FAUNADB_ADMIN_SECRET=
|
||||||
FAUNADB_SERVER_SECRET=
|
FAUNADB_SERVER_SECRET=
|
||||||
|
|
||||||
|
GH_PUBLIC_TOKEN=
|
||||||
|
@ -10,7 +10,7 @@ const username = "jakejarvis";
|
|||||||
async function fetchRepos(sort, limit) {
|
async function fetchRepos(sort, limit) {
|
||||||
const client = new GraphQLClient("https://api.github.com/graphql", {
|
const client = new GraphQLClient("https://api.github.com/graphql", {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
Authorization: `Bearer ${process.env.GH_PUBLIC_TOKEN}`,
|
||||||
Accept: "application/vnd.github.v3+json",
|
Accept: "application/vnd.github.v3+json",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -77,7 +77,7 @@ exports.handler = async (event) => {
|
|||||||
if (event.httpMethod !== "GET") {
|
if (event.httpMethod !== "GET") {
|
||||||
throw new Error(`Method ${event.httpMethod} not allowed.`);
|
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.");
|
throw new Error("GitHub API credentials aren't set.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user