diff --git a/src/services/github-client.ts b/src/services/github-client.ts index b9b7072..125a1e0 100644 --- a/src/services/github-client.ts +++ b/src/services/github-client.ts @@ -62,7 +62,14 @@ export class GitHubClient extends AIFunctionsProvider { this.octokit = new Octokit({ auth: apiKey }) } - async getUser(username: string): Promise { + async getUserByUsername( + usernameOrOpts: string | { username: string } + ): Promise { + const { username } = + typeof usernameOrOpts === 'string' + ? { username: usernameOrOpts } + : usernameOrOpts + const res = await this.octokit.request(`GET /users/${username}`, { headers: { 'X-GitHub-Api-Version': '2022-11-28'