Skip to content

Commit 3def857

Browse files
committed
fix(github): accept github-actions bot when matching sticky comments
1 parent e8531cf commit 3def857

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ type IssueQueryResponse = {
142142
}
143143

144144
const AGENT_USERNAME = "opencode-agent[bot]"
145+
const GITHUB_ACTIONS_BOT_USERNAME = "github-actions[bot]"
145146
const AGENT_REACTION = "eyes"
146147
const WORKFLOW_FILE = ".github/workflows/opencode.yml"
147148

@@ -586,6 +587,7 @@ export const GithubRunCommand = effectCmd({
586587
console.warn(`Warning: failed to resolve authenticated user login: ${String(error)}`)
587588
return AGENT_USERNAME
588589
})
590+
console.log(`Using comment author login: ${commentAuthorLogin}`)
589591

590592
const { userPrompt, promptFiles } = await getUserPrompt()
591593
if (!useGithubToken) {
@@ -1302,7 +1304,11 @@ export const GithubRunCommand = effectCmd({
13021304
issue_number: issueId!,
13031305
per_page: 100,
13041306
})
1305-
const matchedIds = findStickyCommentIds(comments, anchor, [AGENT_USERNAME, commentAuthorLogin])
1307+
const matchedIds = findStickyCommentIds(comments, anchor, [
1308+
AGENT_USERNAME,
1309+
commentAuthorLogin,
1310+
GITHUB_ACTIONS_BOT_USERNAME,
1311+
])
13061312
if (matchedIds.length === 0) return undefined
13071313
if (matchedIds.length > 1) {
13081314
console.warn(`Warning: found ${matchedIds.length} sticky comments with same key; updating the most recent one`)

0 commit comments

Comments
 (0)