Skip to content

Commit 3c6d0a4

Browse files
committed
Add action to run claude on test failure
1 parent 475e457 commit 3c6d0a4

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/claude-fixer.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Claude Test Fixer
2+
on:
3+
workflow_run:
4+
workflows: ["Test all cron (Linux)", "Test all cron (MacOS)"]
5+
types: [completed]
6+
7+
jobs:
8+
fix-on-failure:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
actions: read # Allows Claude to read the logs of the failed run
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Claude Fix Failed Tests
18+
uses: anthropics/claude-code-action@v1
19+
with:
20+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
21+
prompt: |
22+
The "CI Tests" workflow just failed.
23+
1. Analyze the logs from the last failed run.
24+
2. Identify the root cause of the test failure.
25+
3. Implement a fix and create a new pull request.
26+
27+
28+
29+
additional_permissions: |
30+
actions: read

0 commit comments

Comments
 (0)