From e43c1b7facfb79ed6e0e3f9a70188ecdef3e51a0 Mon Sep 17 00:00:00 2001 From: Rodrigo Yokota <53323214+ryok90@users.noreply.github.com> Date: Fri, 4 Jul 2025 15:14:14 -0300 Subject: [PATCH] fix(github): fixing claude login user name (#227) * fix(github): fixing claude login user name * fix: improving bot user identification conditions * fix: making a const out of claude bot id --- src/github/operations/comments/create-initial.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/github/operations/comments/create-initial.ts b/src/github/operations/comments/create-initial.ts index d6087a5..2bac476 100644 --- a/src/github/operations/comments/create-initial.ts +++ b/src/github/operations/comments/create-initial.ts @@ -14,6 +14,8 @@ import { } from "../../context"; import type { Octokit } from "@octokit/rest"; +const CLAUDE_APP_BOT_ID = 209825114; + export async function createInitialComment( octokit: Octokit, context: ParsedGitHubContext, @@ -36,11 +38,15 @@ export async function createInitialComment( repo, issue_number: context.entityNumber, }); - const existingComment = comments.data.find( - (comment) => - comment.user?.login.indexOf("claude[bot]") !== -1 || - comment.body === initialBody, - ); + const existingComment = comments.data.find((comment) => { + const idMatch = comment.user?.id === CLAUDE_APP_BOT_ID; + const botNameMatch = + comment.user?.type === "Bot" && + comment.user?.login.toLowerCase().includes("claude"); + const bodyMatch = comment.body === initialBody; + + return idMatch || botNameMatch || bodyMatch; + }); if (existingComment) { response = await octokit.rest.issues.updateComment({ owner,