@@ -28,8 +28,18 @@ function stepToYaml(step: GhaStep): Record<string, unknown> {
2828}
2929
3030/**
31- * Builds the claude-code-action step.
31+ * Workaround for https://github.com/anthropics/claude-code-action/issues/944
32+ * When track_progress is disabled (labeled events), claude-code-action does not
33+ * post a PR comment automatically. This suffix instructs Claude to post one itself.
3234 */
35+ const LABELED_EVENT_COMMENT_SUFFIX =
36+ "\n\n${{ github.event.action == 'labeled' && format(" +
37+ "'Since this run was triggered by a label event, automatic progress tracking is disabled. " +
38+ "After completing the task, you MUST post your full response as a PR comment. " +
39+ "Write your response to /tmp/claude-response.md, then run: " +
40+ "gh pr comment {0} --repo {1} --body-file /tmp/claude-response.md', " +
41+ "github.event.pull_request.number, github.repository) || '' }}" ;
42+
3343/**
3444 * Default tools that are always allowed. These are all safe, non-mutating
3545 * tools (no permission required) plus scoped Bash patterns for git/gh.
@@ -90,8 +100,8 @@ function buildActionStep(
90100 const withBlock : Record < string , unknown > = {
91101 anthropic_api_key : "${{ secrets.ANTHROPIC_API_KEY }}" ,
92102 github_token : "${{ secrets.GITHUB_TOKEN }}" ,
93- track_progress : true ,
94- prompt,
103+ track_progress : "${{ github.event.action != 'labeled' }}" ,
104+ prompt : prompt + LABELED_EVENT_COMMENT_SUFFIX ,
95105 } ;
96106
97107 const toolArgs = `--allowedTools '${ allowedTools . join ( "," ) } '` ;
0 commit comments