Use Copilot to draft tests and check CI automatically
They let GitHub Copilot create tests and added automated checks in GitHub Actions, which reduced CI failures and sped up merges.
- What they did
- Working on a Node.js microservice, they sent GitHub issues to GitHub Copilot's coding agent and had it open draft pull requests with unit tests. After that, they left comments on the drafts so Copilot could revise them. In week 3, they changed the GitHub Actions pipeline to run Copilot review, inspect failing tests, and attempt vulnerability fixes, while branch protection still forced human review.
- How it went
- Across two weeks, CI test failures moved down from 18% to 9%. The average merge time also improved from 4.2 hours to 2.1 hours. A payment refactor caused 47 test breaks, and a dependency update got stuck in the pipeline.
- Tips
- Before wiring this into your own workflow, confirm the Copilot CLI commands you plan to use actually exist in your environment. The reported gains were the author's own rough two-week figures, so expect results to vary.
Try it yourself with GitHub Copilot
In [owner/repo], have GitHub Copilot draft unit tests for [service, package, or folder] using [test framework]. Open the work as a draft pull request, then stop and ask for my approval before you do anything that would merge, publish, or remove code. After I leave review comments, update the branch and keep iterating until the tests cover the main paths and edge cases. Next, show me how to extend the GitHub Actions workflow so each pull request gets Copilot code review plus a summary of failed tests and possible fixes, but pause again before changing the workflow file or turning on any step that could affect releases.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Set up a file-based system for Copilot agent chats
Use VS Code workspaces and prompt files to route tasks to the right GitHub Copilot agent without juggling dozens of separate chats.
Run Copilot CLI in loops and split multi-part work
Daniel Ward used GitHub Copilot’s autopilot and /fleet features to finish larger jobs and divide separate chunks across parallel agents.
Use Copilot to assemble a FastAPI image browser
A developer asked GitHub Copilot Agent Mode for one FastAPI app and got a working image browser back.
Update a codebase with Copilot in chat and agent mode
A developer used GitHub Copilot to make code changes and preferred the CLI’s autopilot workflow and todo list.
Split development work into phases before using Copilot
A developer plans features in stages first, then feeds the approved steps to GitHub Copilot instead of asking it to make all architecture decisions at once.
Have Copilot repair an existing pull request
A developer used GitHub Copilot to patch a PR, but it created a separate PR instead of updating the original branch.