summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Hill <[email protected]>2025-12-11 16:21:32 +0000
committerDavid Hill <[email protected]>2025-12-11 16:21:32 +0000
commit4e02704f17be406a7cec8b5a815582a08a2043cf (patch)
tree689367bc680d2b9a9a3a1d1e59996bb7ca1f2487
parentb17fdc7f4e30f44800ffc413d6cab823f18adc4b (diff)
parentdf4d9236a69311a2589d98f73b3c22bb5efbb95d (diff)
downloadopencode-4e02704f17be406a7cec8b5a815582a08a2043cf.tar.gz
opencode-4e02704f17be406a7cec8b5a815582a08a2043cf.zip
Merge branch 'dev' of https://github.com/sst/opencode into dev
-rw-r--r--packages/opencode/Dockerfile2
-rw-r--r--packages/opencode/src/cli/cmd/github.ts15
-rwxr-xr-xscript/publish.ts2
3 files changed, 11 insertions, 8 deletions
diff --git a/packages/opencode/Dockerfile b/packages/opencode/Dockerfile
index fbbeacf04..99f593581 100644
--- a/packages/opencode/Dockerfile
+++ b/packages/opencode/Dockerfile
@@ -4,7 +4,7 @@ FROM alpine
# On ephemeral containers, the cache is not useful
ARG BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=${BUN_RUNTIME_TRANSPILER_CACHE_PATH}
-RUN apk add libgcc libstdc++
+RUN apk add libgcc libstdc++ ripgrep
ADD ./dist/opencode-linux-x64-baseline-musl/bin/opencode /usr/local/bin/opencode
RUN opencode --version
ENTRYPOINT ["opencode"]
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({
diff --git a/script/publish.ts b/script/publish.ts
index ce0fd7d0d..d89d270ae 100755
--- a/script/publish.ts
+++ b/script/publish.ts
@@ -155,5 +155,5 @@ if (!Script.preview) {
await $`git cherry-pick HEAD..origin/dev`.nothrow()
await $`git push origin HEAD --tags --no-verify --force-with-lease`
await new Promise((resolve) => setTimeout(resolve, 5_000))
- await $`gh release create v${Script.version} --title "v${Script.version}" --notes ${notes.join("\n") ?? "No notable changes"} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz`
+ await $`gh release create v${Script.version} --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz`
}