anthropics / anthropics/claude-code-action

Claude Code installer outputs garbled text in GitHub Actions logs

Abierto
#882 0 comentarios 1 reacción 0 asignados Ver en GitHub
area:installation bug p2
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

## Description

The Claude Code installer outputs ANSI escape sequences that get corrupted when displayed in GitHub Actions logs, resulting in garbled, unreadable text.

## Current Behavior

When the `claude-code-action` runs in a GitHub Actions workflow, the installation step produces corrupted output like:

```
Installing Clude Cde nive build2.1.25...
Seting uplauncher and shellintegration.
✔Clade Code successfullyinstalled!
Lcation: ~/.local/bin/claud
```

Instead of the expected:

```
Installing Claude Code native build 2.1.25...
Setting up launcher and shell integration.
✔ Claude Code successfully installed!
Location: ~/.local/bin/claude
```

## What We've Tried

We attempted to disable ANSI output by setting standard environment variables at the job level:

```yaml
jobs:
claude-pr-review:
runs-on: ubuntu-latest
env:
TERM: dumb
NO_COLOR: 1
steps:
- name: PR Review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
```

However, the Claude Code installer doesn't respect these environment variables, and the output remains garbled.

## Root Cause

The issue appears to be that:
1. The Claude Code installer outputs ANSI escape sequences for formatting (colors, cursor positioning, etc.)
2. GitHub Actions log viewer doesn't properly render these sequences
3. Instead of stripping them out cleanly, they get partially rendered, causing text corruption

## Proposed Solutions

1. **Respect `NO_COLOR` and `TERM` environment variables** - This is the standard approach used by most CLI tools (see https://no-color.org/)

2. **Add a parameter to disable fancy output** - For example:
```yaml
- uses: anthropics/claude-code-action@v1
with:
plain_output: true
```

3. **Pass a flag to the installer** - If the installer supports it, pass a `--no-ansi` or `--plain` flag when these environment variables are detected

## Related Issues

- [claude-code#15509](https://github.com/anthropics/claude-code/issues/15509) - Feature request for `--no-ansi` flag (which would also solve this issue)

## Impact

- **Log readability**: CI/CD logs are essential for debugging and monitoring, and garbled text makes them difficult to read
- **Professional appearance**: Corrupted output looks unprofessional in build logs
- **Consistency**: Most modern CLI tools respect `NO_COLOR` and `TERM` environment variables

## Environment

- GitHub Actions runner: ubuntu-latest
- claude-code-action version: v1
- Observed across multiple repositories and workflow configurations

Thank you for considering this issue!

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.