anthropics / anthropics/claude-code-action

MCP comment tool escapes ! in HTML comments, making markers visible

未关闭
#971 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug mcp p3
主要语言
TypeScript
星标
8.9k
派生
2.1k
平均合并
3 天 9 小时
30 天内合并 PR
10

描述

## Bug

When using `mcp__github_comment__update_claude_comment` to post a comment containing an HTML comment marker like ``, the `!` character gets escaped to `\!`, resulting in `<\!-- claude-code-review -->` being stored in the comment body.

Since `<\!--` is not valid HTML comment syntax, GitHub renders it as visible text instead of hiding it.

## Reproduction

1. Configure a workflow that uses `claude-code-action` with a prompt instructing Claude to include `` in a comment body via `mcp__github_comment__update_claude_comment`
2. Trigger the workflow
3. Observe the posted comment contains `<\!-- some-marker -->` (with `\!`)

## Expected behavior

The HTML comment `` should be posted verbatim, so GitHub hides it as intended.

## Actual behavior

The `!` is escaped to `\!`, producing `<\!-- some-marker -->` which renders as visible text.

## Root cause

This is likely bash history expansion escaping the `!` character when the comment body passes through a shell context with double quotes. In bash, `!` triggers history expansion inside double-quoted strings and gets escaped to `\!`.

## Example

- PR: https://github.com/shellhub-io/shellhub/pull/5868
- Comment with the issue: https://github.com/shellhub-io/shellhub/pull/5868#issuecomment-3950939724

## Environment

- `anthropics/claude-code-action@v1`
- `--model claude-opus-4-6`
- Using `track_progress` and `mcp__github_comment__update_claude_comment`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。