Skip to content

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 15, 2026

When the Validate workflow fails on a PR from a Claude branch (claude/*), this workflow automatically:

  1. Extracts the failure details and error logs
  2. Invokes Claude Code Action to analyze and fix the issues
  3. Commits and pushes the fixes
  4. 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.

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.
@nhorton nhorton force-pushed the claude/auto-fix-ci-failures-UaTc8 branch from 0a07992 to 09c6b3c Compare January 15, 2026 00:15
Add explicit checks to ensure the workflow doesn't run on main/master
branches, only on PR branches from Claude.
Copy link

Copilot AI left a 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
@nhorton nhorton mentioned this pull request Jan 15, 2026
1 task
@nhorton nhorton requested a review from Copilot January 15, 2026 00:29
Copy link

Copilot AI left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the DCO.
✅ (nhorton)[https://github.com/nhorton]
❌ @Copilot
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@nhorton
Copy link
Contributor Author

nhorton commented Jan 15, 2026

@copilot open a new pull request to apply changes based on the comments in this thread. Also close any stale comments you have left

Copy link
Contributor

Copilot AI commented Jan 15, 2026

@nhorton I've opened a new pull request, #30, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits January 14, 2026 19:33
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants