-
Notifications
You must be signed in to change notification settings - Fork 0
Auto-fix CI failures for Claude contributions #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When the Validate workflow fails on a PR from a Claude branch (claude/*), this workflow automatically: 1. Checks if the last commit was an auto-fix (prevents infinite loops) 2. Extracts the failure details and error logs 3. Invokes Claude Code Action to analyze and fix the issues 4. Commits fixes directly to the same branch with [auto-fix] tag 5. Comments on the PR with the fix status The action supports fixing: - ruff formatting errors - ruff linting errors - pytest test failures Requires ANTHROPIC_API_KEY secret to be configured.
0a07992 to
09c6b3c
Compare
Add explicit checks to ensure the workflow doesn't run on main/master branches, only on PR branches from Claude.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces an automated CI failure fixing workflow that triggers when the "Validate" workflow fails on Claude-authored branches (prefixed with claude/). The workflow extracts failure details, uses the Claude Code Action to analyze and fix the issues, and comments on the PR with the fix status.
Changes:
- Added a new GitHub Actions workflow file that responds to Validate workflow failures
- Implements loop prevention by checking for
[auto-fix]markers in commit messages - Uses GitHub API to extract job logs and Claude Code Action to apply fixes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add PR open check before attempting fixes - Check last 3 commits for [auto-fix] tag (not just last one) - Handle case where workflow fails but no jobs failed - Fix comment step to only run when failure_details succeeded - Remove unnecessary id-token permission - Add note about fork PR limitation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the DCO. |
|
@copilot open a new pull request to apply changes based on the comments in this thread. Also close any stale comments you have left |
…ty (#30) * Initial plan * Address review comments on auto-fix-ci workflow Co-authored-by: nhorton <[email protected]> * Fix trailing spaces in workflow file Co-authored-by: nhorton <[email protected]> * Fix claude_args quoting and improve null check Co-authored-by: nhorton <[email protected]> * Use YAML folded scalar for claude_args to avoid quoting issues Co-authored-by: nhorton <[email protected]> * Fix context object consistency and claude_args formatting Co-authored-by: nhorton <[email protected]> * Add null safety check to PR validation step Co-authored-by: nhorton <[email protected]> * Add JSON parsing safety and quote claude_args properly Co-authored-by: nhorton <[email protected]> * Use validated PR number from pr_check step throughout workflow Co-authored-by: nhorton <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: nhorton <[email protected]>
When the Validate workflow fails on a PR from a Claude branch (claude/*), this workflow automatically:
The action supports fixing:
Requires ANTHROPIC_API_KEY secret to be configured.