0
Get a user
One script reply has been approved by the moderators Verified

Provides publicly available information about someone with a GitHub account.

Created by lplit 598 days ago Viewed 3979 times
0
Submitted by adam186 Deno
Verified 375 days ago
1
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
2

3
type Github = {
4
  token: string;
5
};
6
export async function main(gh_auth: Github, username: string) {
7
  const octokit = new Octokit({ auth: gh_auth.token });
8

9
  return await octokit.request("GET /users/{username}", {
10
    username,
11
    headers: {
12
      "X-GitHub-Api-Version": "2022-11-28",
13
      Accept: "application/vnd.github+json",
14
    },
15
  });
16
}
17

Other submissions