mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
Add explicit fix-ci-commit command for clearer git commit instructions
- Create new slash command specifically for when branch already exists - Makes it crystal clear that Bash tool must be used for git commands - Update workflow to use the new command
This commit is contained in:
56
.claude/commands/fix-ci-commit.md
Normal file
56
.claude/commands/fix-ci-commit.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
description: Fix CI failures and commit changes (for use when branch already exists)
|
||||||
|
allowed_tools: "Read, Write, Edit, MultiEdit, Bash, Grep, Glob, TodoWrite"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Fix CI Failures and Commit
|
||||||
|
|
||||||
|
You are on a branch that was created to fix CI failures. Your task is to fix the issues and commit the changes.
|
||||||
|
|
||||||
|
## CI Failure Information
|
||||||
|
|
||||||
|
$ARGUMENTS
|
||||||
|
|
||||||
|
## Your Tasks
|
||||||
|
|
||||||
|
1. **Analyze the failures** - Understand what went wrong from the logs
|
||||||
|
2. **Fix the issues** - Make the necessary code changes
|
||||||
|
3. **Commit your fixes** - Use git to commit all changes
|
||||||
|
|
||||||
|
## Step-by-Step Instructions
|
||||||
|
|
||||||
|
### 1. Fix the Issues
|
||||||
|
|
||||||
|
Based on the error logs:
|
||||||
|
- Fix syntax errors
|
||||||
|
- Fix formatting issues
|
||||||
|
- Fix test failures
|
||||||
|
- Fix any other CI problems
|
||||||
|
|
||||||
|
### 2. Commit Your Changes (REQUIRED)
|
||||||
|
|
||||||
|
After fixing ALL issues, you MUST:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Stage all changes
|
||||||
|
git add -A
|
||||||
|
|
||||||
|
# Commit with descriptive message
|
||||||
|
git commit -m "Fix CI failures
|
||||||
|
|
||||||
|
- Fixed syntax errors
|
||||||
|
- Fixed formatting issues
|
||||||
|
- Fixed test failures
|
||||||
|
[List actual fixes made]"
|
||||||
|
```
|
||||||
|
|
||||||
|
**IMPORTANT**: You MUST use the Bash tool to run the git add and git commit commands above. The workflow expects you to commit your changes.
|
||||||
|
|
||||||
|
### 3. Verify (Optional)
|
||||||
|
|
||||||
|
If possible, run verification commands:
|
||||||
|
- `bun run format:check` for formatting
|
||||||
|
- `bun test` for tests
|
||||||
|
- `bun run typecheck` for TypeScript
|
||||||
|
|
||||||
|
Begin by analyzing the failure logs and then fix the issues.
|
||||||
@@ -42,11 +42,11 @@ Requirements:
|
|||||||
|
|
||||||
## Step 4: Commit Changes
|
## Step 4: Commit Changes
|
||||||
|
|
||||||
After applying fixes:
|
After applying ALL fixes, use the Bash tool to:
|
||||||
1. Stage all modified files with `git add -A` or `git add .`
|
1. Run: `git add -A` to stage all modified files
|
||||||
2. Commit with a descriptive message using `git commit -m "Fix CI failures: <description>"`
|
2. Run: `git commit -m "Fix CI failures: <description>"` to commit the changes
|
||||||
3. Include details about which CI jobs/tests were fixed in the commit message
|
3. Include details about which CI jobs/tests were fixed in the commit message
|
||||||
4. Important: Always commit your changes even if you're already on a branch
|
4. Important: You MUST use the Bash tool to run these git commands to commit your changes
|
||||||
|
|
||||||
## Step 5: Verify Fixes Locally
|
## Step 5: Verify Fixes Locally
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/auto-fix-ci.yml
vendored
2
.github/workflows/auto-fix-ci.yml
vendored
@@ -80,7 +80,7 @@ jobs:
|
|||||||
uses: km-anthropic/claude-code-action@v1-dev
|
uses: km-anthropic/claude-code-action@v1-dev
|
||||||
with:
|
with:
|
||||||
prompt: |
|
prompt: |
|
||||||
/fix-ci Failed CI Run: ${{ fromJSON(steps.failure_details.outputs.result).runUrl }}
|
/fix-ci-commit Failed CI Run: ${{ fromJSON(steps.failure_details.outputs.result).runUrl }}
|
||||||
Failed Jobs: ${{ join(fromJSON(steps.failure_details.outputs.result).failedJobs, ', ') }}
|
Failed Jobs: ${{ join(fromJSON(steps.failure_details.outputs.result).failedJobs, ', ') }}
|
||||||
|
|
||||||
Error logs:
|
Error logs:
|
||||||
|
|||||||
56
slash-commands/fix-ci-commit.md
Normal file
56
slash-commands/fix-ci-commit.md
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
description: Fix CI failures and commit changes (for use when branch already exists)
|
||||||
|
allowed_tools: "Read, Write, Edit, MultiEdit, Bash, Grep, Glob, TodoWrite"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Fix CI Failures and Commit
|
||||||
|
|
||||||
|
You are on a branch that was created to fix CI failures. Your task is to fix the issues and commit the changes.
|
||||||
|
|
||||||
|
## CI Failure Information
|
||||||
|
|
||||||
|
$ARGUMENTS
|
||||||
|
|
||||||
|
## Your Tasks
|
||||||
|
|
||||||
|
1. **Analyze the failures** - Understand what went wrong from the logs
|
||||||
|
2. **Fix the issues** - Make the necessary code changes
|
||||||
|
3. **Commit your fixes** - Use git to commit all changes
|
||||||
|
|
||||||
|
## Step-by-Step Instructions
|
||||||
|
|
||||||
|
### 1. Fix the Issues
|
||||||
|
|
||||||
|
Based on the error logs:
|
||||||
|
- Fix syntax errors
|
||||||
|
- Fix formatting issues
|
||||||
|
- Fix test failures
|
||||||
|
- Fix any other CI problems
|
||||||
|
|
||||||
|
### 2. Commit Your Changes (REQUIRED)
|
||||||
|
|
||||||
|
After fixing ALL issues, you MUST:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Stage all changes
|
||||||
|
git add -A
|
||||||
|
|
||||||
|
# Commit with descriptive message
|
||||||
|
git commit -m "Fix CI failures
|
||||||
|
|
||||||
|
- Fixed syntax errors
|
||||||
|
- Fixed formatting issues
|
||||||
|
- Fixed test failures
|
||||||
|
[List actual fixes made]"
|
||||||
|
```
|
||||||
|
|
||||||
|
**IMPORTANT**: You MUST use the Bash tool to run the git add and git commit commands above. The workflow expects you to commit your changes.
|
||||||
|
|
||||||
|
### 3. Verify (Optional)
|
||||||
|
|
||||||
|
If possible, run verification commands:
|
||||||
|
- `bun run format:check` for formatting
|
||||||
|
- `bun test` for tests
|
||||||
|
- `bun run typecheck` for TypeScript
|
||||||
|
|
||||||
|
Begin by analyzing the failure logs and then fix the issues.
|
||||||
Reference in New Issue
Block a user