Skip to content

Commit a75252f

Browse files
committed
chore: use authenticated GitHub API locally if token is present
1 parent 759907d commit a75252f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utilities/githubAPI.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if (
2020
});
2121
console.log('api is authenticated on vercel');
2222
} else {
23-
api = new GithubAPI();
24-
console.log('api is not authenticated');
23+
api = new GithubAPI({
24+
auth: process.env.GITHUB_TOKEN,
25+
});
26+
console.log(typeof process.env.GITHUB_TOKEN === "undefined" ? 'api is not authenticated' : 'api is authenticated locally');
2527
}
2628
export default api;

0 commit comments

Comments
 (0)