summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDaniel Polito <[email protected]>2025-12-11 12:42:10 -0300
committerGitHub <[email protected]>2025-12-11 09:42:10 -0600
commitdce4585d40b8ac36caf38c9521f434597e8a5bd9 (patch)
tree62c9c24adce76cb31e30dc311f03da6ef3feb043
parent5e7d908dc9d1ecb00f7b7aee4b8b68e26232c50a (diff)
downloadopencode-dce4585d40b8ac36caf38c9521f434597e8a5bd9.tar.gz
opencode-dce4585d40b8ac36caf38c9521f434597e8a5bd9.zip
Fix / Improve Github Eyes Reaction Removal (#5383)
-rw-r--r--packages/opencode/src/cli/cmd/github.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts
index c61c2c491..55d9fb19d 100644
--- a/packages/opencode/src/cli/cmd/github.ts
+++ b/packages/opencode/src/cli/cmd/github.ts
@@ -124,6 +124,8 @@ type IssueQueryResponse = {
}
}
+const AGENT_USERNAME = "opencode-agent[bot]"
+const AGENT_REACTION = "eyes"
const WORKFLOW_FILE = ".github/workflows/opencode.yml"
export const GithubCommand = cmd({
@@ -422,7 +424,7 @@ export const GithubRunCommand = cmd({
await configureGit(appToken)
await assertPermissions()
- await addReaction("eyes")
+ await addReaction()
// Setup opencode session
const repoData = await fetchRepo()
@@ -812,8 +814,8 @@ export const GithubRunCommand = cmd({
await $`git config --local --unset-all ${config}`
await $`git config --local ${config} "AUTHORIZATION: basic ${newCredentials}"`
- await $`git config --global user.name "opencode-agent[bot]"`
- await $`git config --global user.email "opencode-agent[bot]@users.noreply.github.com"`
+ await $`git config --global user.name "${AGENT_USERNAME}"`
+ await $`git config --global user.email "${AGENT_USERNAME}@users.noreply.github.com"`
}
async function restoreGitConfig() {
@@ -935,13 +937,13 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
if (!["admin", "write"].includes(permission)) throw new Error(`User ${actor} does not have write permissions`)
}
- async function addReaction(reaction: "eyes") {
+ async function addReaction() {
console.log("Adding reaction...")
return await octoRest.rest.reactions.createForIssueComment({
owner,
repo,
comment_id: triggerCommentId,
- content: reaction,
+ content: AGENT_REACTION,
})
}
@@ -951,9 +953,10 @@ Co-authored-by: ${actor} <${actor}@users.noreply.github.com>"`
owner,
repo,
comment_id: triggerCommentId,
+ content: AGENT_REACTION,
})
- const eyesReaction = reactions.data.find((r) => r.content === "eyes")
+ const eyesReaction = reactions.data.find((r) => r.user?.login === AGENT_USERNAME)
if (!eyesReaction) return
await octoRest.rest.reactions.deleteForIssueComment({