The open source coding agent.
TypeScript
ignore: fix type issue
Aiden Cline14e823e93878
diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.tsindex 5f9bcded1df..b255e17d1b3 100644--- a/packages/opencode/src/cli/cmd/github.ts+++ b/packages/opencode/src/cli/cmd/github.ts@@ -390,6 +390,7 @@ export const GithubRunCommand = cmd({const share = normalizeShare()const { owner, repo } = context.repoconst payload = context.payload as IssueCommentEvent | PullRequestReviewCommentEvent+ const issueEvent = isIssueCommentEvent(payload) ? payload : undefinedconst actor = context.actorconst issueId =@@ -440,7 +441,7 @@ export const GithubRunCommand = cmd({// 1. Issue// 2. Local PR// 3. Fork PR- if (payload.issue.pull_request) {+ if (context.eventName === "pull_request_review_comment" || issueEvent?.issue.pull_request) {const prData = await fetchPR()// Local PRif (prData.headRepository.nameWithOwner === prData.baseRepository.nameWithOwner) {@@ -537,6 +538,12 @@ export const GithubRunCommand = cmd({throw new Error(`Invalid share value: ${value}. Share must be a boolean.`)}+ function isIssueCommentEvent(+ event: IssueCommentEvent | PullRequestReviewCommentEvent,+ ): event is IssueCommentEvent {+ return "issue" in event+ }+function getReviewCommentContext() {if (context.eventName !== "pull_request_review_comment") {return null@@ -686,7 +693,10 @@ export const GithubRunCommand = cmd({try {return await chat(`Summarize the following in less than 40 characters:\n\n${response}`)} catch (e) {- return `Fix issue: ${payload.issue.title}`+ const title = issueEvent+ ? issueEvent.issue.title+ : (payload as PullRequestReviewCommentEvent).pull_request.title+ return `Fix issue: ${title}`}}