Skip to content

Conversation

@huuyafwww
Copy link

@huuyafwww huuyafwww commented Oct 30, 2025

Hello, thank you for developing such an excellent library.
I am currently using this action in my project.
I'm utilizing the use_sticky_comment option, but
a new comment is created with every commit.

Upon investigating the cause, I found that the bot user commenting in my project was not Claude.
Therefore, the use_sticky_comment option is not functioning properly.
When Claude runs, it first comments “Claude Code is working…”, right?
It reflects the execution results by updating this comment.
However, when a new commit is added, it cannot find an existingComment , so it creates a new comment again.

In my project, the GitHub Actions official user comments,
but the current code only considers comments made by the official Claude App user.
Therefore, I modified it so that if the botId in the actions input matches, it is also recognized as an existingComment .
This allows existingComments to be found even when users other than the official Claude App comment.

Once this change is reflected, my project will specify botId as 41898282 .
Below is the information for the GitHub Actions bot.
https://api.github.com/users/github-actions[bot]

});
const existingComment = comments.data.find((comment) => {
const idMatch = comment.user?.id === CLAUDE_APP_BOT_ID;
const idMatch = comment.user?.id === CLAUDE_APP_BOT_ID || comment.user?.id === parseInt(context.inputs.botId);
Copy link

@ad-m-ss ad-m-ss Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const idMatch = comment.user?.id === CLAUDE_APP_BOT_ID || comment.user?.id === parseInt(context.inputs.botId);
const idMatch = comment.user?.id === parseInt(context.inputs.botId);

Why is there a need for a hardcoded constant if that value is also defined in https://github.com/huuyafwww/claude-code-action/blob/87cf21a4f276c5c71a16d388a981a6f16ba7af13/action.yml#L83 ? If there are no hardcoded constants, there won't be such mistakes, and there will only be one way for it to work.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW. That constant is duplicated:

export const CLAUDE_APP_BOT_ID = 41898282;
,
const CLAUDE_APP_BOT_ID = 209825114;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two different numbers, so never mind.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ad-m-ss
Thank you!
I've fixed it in the following commit.

1b026cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants