| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6f43d03 commit 8b298a2
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,10 @@ inputs: | |||
| 26 | 26 | description: "Comma-separated list of trigger phrases (case-insensitive). Defaults to '/opencode,/oc'" | |
| 27 | 27 | required: false | |
| 28 | 28 | ||
| 29 | + oidc_base_url: | ||
| 30 | + description: "Base URL for OIDC token exchange API. Only required when running a custom GitHub App install. Defaults to https://api.opencode.ai" | ||
| 31 | + required: false | ||
| 32 | + | ||
| 29 | 33 | runs: | |
| 30 | 34 | using: "composite" | |
| 31 | 35 | steps: | |
@@ -62,3 +66,4 @@ runs: | |||
| 62 | 66 | PROMPT: ${{ inputs.prompt }} | |
| 63 | 67 | USE_GITHUB_TOKEN: ${{ inputs.use_github_token }} | |
| 64 | 68 | MENTIONS: ${{ inputs.mentions }} | |
| 69 | + OIDC_BASE_URL: ${{ inputs.oidc_base_url }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -395,6 +395,7 @@ export const GithubRunCommand = cmd({ | |||
| 395 | 395 | const { providerID, modelID } = normalizeModel() | |
| 396 | 396 | const runId = normalizeRunId() | |
| 397 | 397 | const share = normalizeShare() | |
| 398 | + const oidcBaseUrl = normalizeOidcBaseUrl() | ||
| 398 | 399 | const { owner, repo } = context.repo | |
| 399 | 400 | const payload = context.payload as IssueCommentEvent | PullRequestReviewCommentEvent | |
| 400 | 401 | const issueEvent = isIssueCommentEvent(payload) ? payload : undefined | |
@@ -572,6 +573,12 @@ export const GithubRunCommand = cmd({ | |||
| 572 | 573 | throw new Error(`Invalid use_github_token value: ${value}. Must be a boolean.`) | |
| 573 | 574 | } | |
| 574 | 575 | ||
| 576 | + function normalizeOidcBaseUrl(): string { | ||
| 577 | + const value = process.env["OIDC_BASE_URL"] | ||
| 578 | + if (!value) return "https://api.opencode.ai" | ||
| 579 | + return value.replace(/\/+$/, "") | ||
| 580 | + } | ||
| 581 | + | ||
| 575 | 582 | function isIssueCommentEvent( | |
| 576 | 583 | event: IssueCommentEvent | PullRequestReviewCommentEvent, | |
| 577 | 584 | ): event is IssueCommentEvent { | |
@@ -809,14 +816,14 @@ export const GithubRunCommand = cmd({ | |||
| 809 | 816 | ||
| 810 | 817 | async function exchangeForAppToken(token: string) { | |
| 811 | 818 | const response = token.startsWith("github_pat_") | |
| 812 | - ? await fetch("https://api.opencode.ai/exchange_github_app_token_with_pat", { | ||
| 819 | + ? await fetch(`${oidcBaseUrl}/exchange_github_app_token_with_pat`, { | ||
| 813 | 820 | method: "POST", | |
| 814 | 821 | headers: { | |
| 815 | 822 | Authorization: `Bearer ${token}`, | |
| 816 | 823 | }, | |
| 817 | 824 | body: JSON.stringify({ owner, repo }), | |
| 818 | 825 | }) | |
| 819 | - : await fetch("https://api.opencode.ai/exchange_github_app_token", { | ||
| 826 | + : await fetch(`${oidcBaseUrl}/exchange_github_app_token`, { | ||
| 820 | 827 | method: "POST", | |
| 821 | 828 | headers: { | |
| 822 | 829 | Authorization: `Bearer ${token}`, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments