send auth token to get container registry url endpoint
This commit is contained in:
+10
-2
@@ -34,10 +34,18 @@ export async function getRepositoryMetadata(
|
||||
}
|
||||
|
||||
export async function getContainerRegistryURL(
|
||||
githubAPIURL: string
|
||||
githubAPIURL: string,
|
||||
token: string
|
||||
): Promise<URL> {
|
||||
const response = await fetch(
|
||||
`${githubAPIURL}/packages/container-registry-url`
|
||||
`${githubAPIURL}/packages/container-registry-url`,
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
Accept: 'application/vnd.github.v3+json'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
|
||||
+4
-2
@@ -92,8 +92,10 @@ export async function resolvePublishActionOptions(): Promise<PublishActionOption
|
||||
}
|
||||
|
||||
// Required Values fetched from the GitHub API
|
||||
const containerRegistryUrl: URL =
|
||||
await apiClient.getContainerRegistryURL(apiBaseUrl)
|
||||
const containerRegistryUrl: URL = await apiClient.getContainerRegistryURL(
|
||||
apiBaseUrl,
|
||||
token
|
||||
)
|
||||
|
||||
const isEnterprise =
|
||||
!githubServerUrl.includes('https://github.com') &&
|
||||
|
||||
Reference in New Issue
Block a user