anthropics / anthropics/claude-code-action

Claude cannot commit files

Open
#36 5 comments 4 reactions 2 assignees Claimed by @ltawfik View on GitHub
p1
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Had a success in getting claude to write a feature branch, however when I ask it in a separate issue to create a CI file (for running tests in ruby on rails). It runs correctly but is unable to commit or push its changes.

Everytime it fails with different tool use failures. I tried allowing more bash commands but it always does something slightly different. It even tries tools it has access to but then says it doesn't? Unsure why it works in my first use case but not for this. It has failed 3 times for this issue.

```
`The workflow file has been created locally. However, I need additional permissions to commit the file to the repository. You can commit the changes manually:

git add .github/workflows/ci.yml
git commit -m "Add GitHub Actions CI workflow

Implements continuous integration with:
- Ruby 3.3.7 and Rails 8.0.1 setup
- SQLite database for testing
- Runs on push to main and pull requests
- Executes both unit tests and system tests

Resolves #4

🤖 Generated with [Claude Code](https://claude.ai/code)"
git push origin claude/issue-4-20250523_101924`

```

Sample action logs:
```

{
"type": "user",
"message": {
"role": "user",
"content": [
{
"type": "tool_result",
"content": "Error calling tool commit_files: undefined",
"is_error": true,
"tool_use_id": "toolu_01ApVXDnDAGNM6KmC5WpBXCj"
}
]
},
"session_id": "b0074f82-3c98-49f3-8ec3-99ecd7d976ad"
},
{
"type": "assistant",
"message": {
"id": "msg_01Vcy3hk5fdddodPNtLD8e9o",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-4-20250514",
"content": [
{
"type": "tool_use",
"id": "toolu_01UQbijo2RYBrsv2RJdztFTy",
"name": "mcp__github__create_or_update_file",
"input": {
"owner": "TEGeorge",
"repo": "damn",
"path": ".github/workflows/ci.yml",
"content": "name: CI\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n test:\n runs-on: ubuntu-latest\n \n services:\n sqlite:\n image: alpine:latest\n options: >-\n --health-cmd \"true\"\n --health-interval 10s\n --health-timeout 5s\n --health-retries 5\n\n steps:\n - name: Checkout code\n uses: actions/checkout@v4\n\n - name: Set up Ruby\n uses: ruby/setup-ruby@v1\n with:\n ruby-version: 3.3.7\n bundler-cache: true\n\n - name: Set up database\n run: |\n cd dam\n bundle exec rails db:create RAILS_ENV=test\n bundle exec rails db:migrate RAILS_ENV=test\n\n - name: Run tests\n run: |\n cd dam\n bundle exec rails test\n\n - name: Run system tests\n run: |\n cd dam\n bundle exec rails test:system",
"message": "Add GitHub Actions CI workflow\n\nImplements continuous integration with:\n- Ruby 3.3.7 and Rails 8.0.1 setup\n- SQLite database for testing\n- Runs on push to main and pull requests\n- Executes both unit tests and system tests\n\nResolves #4\n\nCo-authored-by: TEGeorge ",
"branch": "claude/issue-4-20250523_100046"
}
}
],
"stop_reason": "tool_use",
"stop_sequence": null,
"usage": {
"input_tokens": 5,
"cache_creation_input_tokens": 207,
"cache_read_input_tokens": 34371,
"output_tokens": 522,
"service_tier": "standard"
}
},
"session_id": "b0074f82-3c98-49f3-8ec3-99ecd7d976ad"
},
{
"type": "user",
"message": {
"role": "user",
"content": [
{
"type": "tool_result",
"content": "Claude requested permissions to use mcp__github__create_or_update_file, but you haven't granted it yet.",
"is_error": true,
"tool_use_id": "toolu_01UQbijo2RYBrsv2RJdztFTy"
}
]
},
"session_id": "b0074f82-3c98-49f3-8ec3-99ecd7d976ad"
},
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.