Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/scripts/update-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,17 @@ async function fetchUserInfo(username, retryCount = 0) {
throw new Error(`Hit max retries (${MAX_RETRIES}) for fetching user ${username}`);
}

const res = await fetch(`https://api.github.com/users/${username}`, {
const request = new Request(`https://api.github.com/users/${username}`, {
headers: {
Accept: "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
},
});
if (process.env.GITHUB_TOKEN) {
request.headers.set("Authorization", `Bearer ${process.env.GITHUB_TOKEN}`);
}

const res = await fetch(request);

if (!res.ok) {
const retryAfter = res.headers.get("retry-after"); // seconds
Expand Down