auth header

This commit is contained in:
Edwin Sirko
2024-01-29 18:35:12 -05:00
parent 54d0a402f9
commit c0f3a2de99
+7 -2
View File
@@ -6,8 +6,13 @@ export async function getRepositoryMetadata(
token: string token: string
): Promise<{ repoId: string; ownerId: string }> { ): Promise<{ repoId: string; ownerId: string }> {
const response = await fetch( 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) { if (!response.ok) {
throw new Error( throw new Error(