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
Generated Vendored
+1 -8
View File
@@ -33566,14 +33566,7 @@ async function run() {
if (token === undefined) {
throw new Error('GITHUB_TOKEN is not set');
}
let endpoint = coreExports.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 = coreExports.getInput('endpoint');
const client = createClient(endpoint, new AzureKeyCredential(token));
const response = await client.path('/chat/completions').post({
body: {
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long