Add Copilot Autofix Workflow for Test Failure Remediation#962
Open
Add Copilot Autofix Workflow for Test Failure Remediation#962
Conversation
- Add GitHub Actions workflow (copilot-auto-issues) triggered on push to master and manual dispatch - Workflow analyzes commits for bugs, security issues, code smells, missing tests, docs gaps, and performance problems - Automatically creates labeled GitHub issues with detailed context, reproduction steps, and suggested fixes - Includes compiled lock.yml workflow definition generated by gh-aw - Add .gitattributes for linguist-generated marking of lock files - Add actions-lock.json for pinned action versions
Minimum allowed line rate is |
- Change trigger from push-to-master to workflow_run (Run tests, CodeQL, dynamic) - Add fork validation and dangerous-triggers security annotations - Add workflow_run HTML URL to environment for issue context - Simplify concurrency group to workflow-level
Replaced the generic code-analysis-and-issue-creation workflow with a targeted autofix workflow that responds to test failures on PRs: - Renamed workflow from copilot-auto-issues to copilot-autofix - Triggers on 'Run tests' workflow_run completion (not push) - Gates on failure conclusion — does nothing when tests pass - Posts fix suggestions directly on the failing PR (not new issues) - Uses GitHub suggestion blocks for one-click acceptance - Analyzes JUnit XML test artifacts to identify root causes - Scoped to only fix what's needed to make failing tests pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a Copilot Autofix GitHub Actions workflow that automatically analyzes test failures on pull requests and posts fix suggestions directly on the failing PR.
What Changed (Latest)
The workflow was completely reworked from a generic "scan code and create issues" approach to a targeted test-failure autofix model:
Run testsworkflow completioncopilot-auto-issuescopilot-autofixWorkflow Behavior
Triggers:
workflow_runcompletion for theRun testsworkflow (onmasterbranch)On test failure, Copilot will:
test-results-*) for failing test paths, errors, stack traces, and platform infosuggestionblocksScope rules:
Files
.github/workflows/copilot-autofix.md.github/workflows/copilot-autofix.lock.ymlgh aw compile).github/aw/actions-lock.json.gitattributes.lock.ymlas linguist-generated, merge strategyoursSecurity
workflow_runtriggers guarded against fork-based attackscontents: read,pull-requests: read,actions: readTesting
gh aw compilegh aw run copilot-autofixRun testsfailure on a PRRelated
actions/github-script@v8,github/gh-aw/actions/setup@v0.50.4