Skip to content

Commit 240b957

Browse files
authored
chore: use authenticated GitHub API locally if token is present (#7456)
1 parent 727ae06 commit 240b957

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/utilities/githubAPI.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ 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(
27+
typeof process.env.GITHUB_TOKEN === 'undefined'
28+
? 'api is not authenticated'
29+
: 'api is authenticated locally'
30+
);
2531
}
2632
export default api;

0 commit comments

Comments
 (0)