diff --git a/src/github/operations/comments/create-initial.ts b/src/github/operations/comments/create-initial.ts index 02a3e18..e6d2930 100644 --- a/src/github/operations/comments/create-initial.ts +++ b/src/github/operations/comments/create-initial.ts @@ -50,41 +50,13 @@ export async function createInitialComment( ); const existingComment = comments.find((comment) => { - if (botIdentifier) { - // Check for our hidden header (case-insensitive, whitespace-tolerant) - const headerPattern = new RegExp( - ``, - "i", - ); - const hasOurHeader = headerPattern.test(comment.body || ""); + if (!botIdentifier) return false; - // Check if comment has ANY bot header - const hasAnyHeader = //.test( - comment.body || "", - ); - - // Header match is authoritative — no bot ID check needed - if (hasAnyHeader) { - return hasOurHeader; - } - - // Legacy comments (no header): require bot ID + Claude content - const idMatch = comment.user?.id === Number(context.inputs.botId); - if (!idMatch) return false; - - const isClaudeComment = - comment.body?.includes("Claude Code is working") || - comment.body?.includes("View job run"); - - return isClaudeComment; - } - - // Fallback when no botIdentifier: match by bot user - const idMatch = comment.user?.id === Number(context.inputs.botId); - const botNameMatch = - comment.user?.type === "Bot" && - comment.user?.login.toLowerCase().includes("claude"); - return idMatch || botNameMatch; + const headerPattern = new RegExp( + ``, + "i", + ); + return headerPattern.test(comment.body || ""); }); if (existingComment) {