Use user-provided endpoint

This commit is contained in:
Sean Goedecke
2025-04-08 20:22:47 +00:00
parent 83d9668e82
commit 84fee7a0e6
4 changed files with 4 additions and 21 deletions

View File

@@ -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))