Use user-provided endpoint
This commit is contained in:
+1
-8
@@ -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: {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user