mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 23:14:13 +08:00
Compare commits
1 Commits
ashwin/sti
...
v0.0.29
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e43c1b7fac |
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user