mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-24 07:24:12 +08:00
Compare commits
1 Commits
v0.0.29
...
ashwin/sti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7925dd1804 |
@@ -14,8 +14,6 @@ import {
|
|||||||
} from "../../context";
|
} from "../../context";
|
||||||
import type { Octokit } from "@octokit/rest";
|
import type { Octokit } from "@octokit/rest";
|
||||||
|
|
||||||
const CLAUDE_APP_BOT_ID = 209825114;
|
|
||||||
|
|
||||||
export async function createInitialComment(
|
export async function createInitialComment(
|
||||||
octokit: Octokit,
|
octokit: Octokit,
|
||||||
context: ParsedGitHubContext,
|
context: ParsedGitHubContext,
|
||||||
@@ -38,15 +36,16 @@ export async function createInitialComment(
|
|||||||
repo,
|
repo,
|
||||||
issue_number: context.entityNumber,
|
issue_number: context.entityNumber,
|
||||||
});
|
});
|
||||||
const existingComment = comments.data.find((comment) => {
|
console.log("users");
|
||||||
const idMatch = comment.user?.id === CLAUDE_APP_BOT_ID;
|
comments.data.forEach((comment) => {
|
||||||
const botNameMatch =
|
console.log(comment.user);
|
||||||
comment.user?.type === "Bot" &&
|
|
||||||
comment.user?.login.toLowerCase().includes("claude");
|
|
||||||
const bodyMatch = comment.body === initialBody;
|
|
||||||
|
|
||||||
return idMatch || botNameMatch || bodyMatch;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const existingComment = comments.data.find(
|
||||||
|
(comment) =>
|
||||||
|
comment.user?.login.indexOf("claude[bot]") !== -1 ||
|
||||||
|
comment.body === initialBody,
|
||||||
|
);
|
||||||
if (existingComment) {
|
if (existingComment) {
|
||||||
response = await octokit.rest.issues.updateComment({
|
response = await octokit.rest.issues.updateComment({
|
||||||
owner,
|
owner,
|
||||||
|
|||||||
Reference in New Issue
Block a user