We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afaedf6 commit 4738a2dCopy full SHA for 4738a2d
src/main.ts
@@ -22,7 +22,18 @@ export async function run(): Promise<void> {
22
if (token === undefined) {
23
throw new Error('GITHUB_TOKEN is not set')
24
}
25
- const endpoint = core.getInput('endpoint')
+
26
+ let endpoint = core.getInput('endpoint')
27
28
+ // If we're in an org-owned repository, we should use the org-owned endpoint
29
+ const repoOwner = process.env.GITHUB_REPOSITORY_OWNER
30
+ const ownerType = process.env.GITHUB_REPOSITORY_OWNER_TYPE
31
+ if (
32
+ endpoint == 'https://models.github.ai/inference' &&
33
+ ownerType == 'Organization'
34
+ ) {
35
+ endpoint = `https://models.github.ai/${repoOwner}/inference`
36
+ }
37
38
const client = ModelClient(endpoint, new AzureKeyCredential(token))
39
0 commit comments