Use user-provided endpoint
This commit is contained in:
12
src/main.ts
12
src/main.ts
@@ -23,17 +23,7 @@ export async function run(): Promise<void> {
|
||||
throw new Error('GITHUB_TOKEN is not set')
|
||||
}
|
||||
|
||||
let endpoint = core.getInput('endpoint')
|
||||
|
||||
// If we're in an org-owned repository, we should use the org-owned endpoint
|
||||
const repoOwner = process.env.GITHUB_REPOSITORY_OWNER
|
||||
const ownerType = process.env.GITHUB_REPOSITORY_OWNER_TYPE
|
||||
if (
|
||||
endpoint == 'https://models.github.ai/inference' &&
|
||||
ownerType == 'Organization'
|
||||
) {
|
||||
endpoint = `https://models.github.ai/${repoOwner}/inference`
|
||||
}
|
||||
const endpoint = core.getInput('endpoint')
|
||||
|
||||
const client = ModelClient(endpoint, new AzureKeyCredential(token))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user