Skip to content

Feature Request: Add option to disable Claude Code Report in GitHub Step Summary #206

@chilang

Description

@chilang

Feature Request: Add option to disable Claude Code Report in GitHub Step Summary

Problem Description

Currently, the Claude Code Action automatically adds a "Claude Code Report" section to the GitHub Step Summary that displays the entire JSON execution output. This happens in the "Display Claude Code Report" step (lines 183-191 in action.yml):

- name: Display Claude Code Report
  if: steps.prepare.outputs.contains_trigger == 'true' && steps.claude-code.outputs.execution_file != ''
  shell: bash
  run: |
    echo "## Claude Code Report" >> $GITHUB_STEP_SUMMARY
    echo '```json' >> $GITHUB_STEP_SUMMARY
    cat "${{ steps.claude-code.outputs.execution_file }}" >> $GITHUB_STEP_SUMMARY
    echo '```' >> $GITHUB_STEP_SUMMARY

While this is useful for debugging, it can conflict with custom formatting solutions that process the execution output.

Use Case

I've created a Claude Output Formatter GitHub Action that takes the Claude execution JSON and formats it into a more readable markdown format with:

  • Structured conversation flow
  • Token usage summaries
  • Execution statistics
  • Collapsible sections for long content
  • Customizable output options

However, when using both actions together, the GitHub Step Summary shows:

  1. The raw JSON from Claude Code Action's "Claude Code Report"
  2. The nicely formatted output from my formatter

This creates duplicate information and makes the step summary unnecessarily long.

Proposed Solution

Add an optional input parameter to control whether the Claude Code Report is displayed:

inputs:
  display_report:
    description: "Whether to display the Claude Code Report in GitHub Step Summary"
    required: false
    default: "true"

Then modify the Display Claude Code Report step to check this input:

- name: Display Claude Code Report
  if: steps.prepare.outputs.contains_trigger == 'true' && steps.claude-code.outputs.execution_file != '' && inputs.display_report != 'false'
  shell: bash
  run: |
    echo "## Claude Code Report" >> $GITHUB_STEP_SUMMARY
    echo '```json' >> $GITHUB_STEP_SUMMARY
    cat "${{ steps.claude-code.outputs.execution_file }}" >> $GITHUB_STEP_SUMMARY
    echo '```' >> $GITHUB_STEP_SUMMARY

Benefits

  1. Backward compatibility: Default behavior remains unchanged
  2. Flexibility: Users can opt out when using custom formatting
  3. Cleaner output: Avoids duplicate information in step summaries
  4. Better integration: Enables third-party tools to provide enhanced formatting

Example Usage

Users could then disable the default report when using custom formatting:

- name: Claude Code Action
  uses: anthropics/claude-code-action@main
  with:
    trigger_phrase: "@claude"
    display_report: false  # Disable default report
  id: claude

- name: Format Claude Output
  uses: atlasfutures/claude-output-formatter@main
  with:
    execution_file: ${{ steps.claude.outputs.execution_file }}
    format_type: markdown

Alternative Solutions Considered

  1. Clearing the step summary after Claude Code Action runs - This works but feels hacky and might clear other important information
  2. Forking the action - Creates maintenance burden and divergence from official action

Additional Context

The raw JSON in the Claude Code Report can be quite large (often hundreds of lines), making it difficult to find the actual formatted results below it when using custom formatting solutions.

Would you be open to accepting a PR for this feature? I'd be happy to implement it if you agree with the approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3Minor bug or general feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions