GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — github: add OIDC_BASE_URL for custom GitHub App installs (#5756) · makeone/opencode@8b298a2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • github
    • action.yml
  • packages/opencode/src/cli/cmd
    • github.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎github/action.yml‎

Copy file name to clipboardExpand all lines: github/action.yml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ inputs:
2626
description: "Comma-separated list of trigger phrases (case-insensitive). Defaults to '/opencode,/oc'"
2727
required: false
2828

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+
2933
runs:
3034
using: "composite"
3135
steps:
@@ -62,3 +66,4 @@ runs:
6266
PROMPT: ${{ inputs.prompt }}
6367
USE_GITHUB_TOKEN: ${{ inputs.use_github_token }}
6468
MENTIONS: ${{ inputs.mentions }}
69+
OIDC_BASE_URL: ${{ inputs.oidc_base_url }}
Collapse file

‎packages/opencode/src/cli/cmd/github.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/github.ts
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ export const GithubRunCommand = cmd({
395395
const { providerID, modelID } = normalizeModel()
396396
const runId = normalizeRunId()
397397
const share = normalizeShare()
398+
const oidcBaseUrl = normalizeOidcBaseUrl()
398399
const { owner, repo } = context.repo
399400
const payload = context.payload as IssueCommentEvent | PullRequestReviewCommentEvent
400401
const issueEvent = isIssueCommentEvent(payload) ? payload : undefined
@@ -572,6 +573,12 @@ export const GithubRunCommand = cmd({
572573
throw new Error(`Invalid use_github_token value: ${value}. Must be a boolean.`)
573574
}
574575

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+
575582
function isIssueCommentEvent(
576583
event: IssueCommentEvent | PullRequestReviewCommentEvent,
577584
): event is IssueCommentEvent {
@@ -809,14 +816,14 @@ export const GithubRunCommand = cmd({
809816

810817
async function exchangeForAppToken(token: string) {
811818
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`, {
813820
method: "POST",
814821
headers: {
815822
Authorization: `Bearer ${token}`,
816823
},
817824
body: JSON.stringify({ owner, repo }),
818825
})
819-
: await fetch("https://api.opencode.ai/exchange_github_app_token", {
826+
: await fetch(`${oidcBaseUrl}/exchange_github_app_token`, {
820827
method: "POST",
821828
headers: {
822829
Authorization: `Bearer ${token}`,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.