From c0f3a2de990dfa81cf6c1d4eaca42a3488d3cd19 Mon Sep 17 00:00:00 2001 From: Edwin Sirko Date: Mon, 29 Jan 2024 18:35:12 -0500 Subject: [PATCH] auth header --- src/api-client.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index 0db3011..a665091 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -6,8 +6,13 @@ export async function getRepositoryMetadata( token: string ): Promise<{ repoId: string; ownerId: string }> { const response = await fetch( - `${process.env.GITHUB_API_URL}/repos/${repository}` - ) + `${process.env.GITHUB_API_URL}/repos/${repository}`, { + method: 'GET', + headers: { + 'Authorization': `Bearer ${token}`, + 'Accept': 'application/vnd.github.v3+json' + } + }) if (!response.ok) { throw new Error(