Repository navigation
Fix copilot PR search logic to find PRs created by Copilot bot - #1972
Merged
Merged
Conversation
Updated copilot-agent-analysis.md to use correct search strategy: - GitHub API doesn't support author:bot_name for bot accounts - Use keyword search: "START COPILOT CODING AGENT" which appears in all Copilot PRs - Alternative: list_pull_requests + filter by user.login=="Copilot" and user.id==198982749 - Updated all references from copilot-swe-agent to Copilot - Tested: keyword search returns 881 PRs vs 0 with old author: search Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix search logic in copilot audit workflows
Fix copilot PR search logic to find PRs created by Copilot bot
Oct 19, 2025
pelikhan
marked this pull request as ready for review
October 19, 2025 16:01
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
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.
Problem
The
copilot-agent-analysisworkflow was unable to find PRs created by the Copilot coding agent because it was using an incorrect search strategy. The workflow searched forauthor:copilot-swe-agent, which returned 0 results.Investigation revealed that:
Copilot(ID: 198982749, type: Bot)author:filter for bot accountsThis caused the daily analysis workflow to report only 1 PR when it should have found hundreds, as referenced in discussion #1966.
Solution
Updated the workflow instructions to use keyword-based search instead of author-based search:
This searches for the signature text that Copilot automatically adds to all PR bodies, which is both reliable and efficient.
Alternative Strategies Provided
The workflow now documents three approaches for finding Copilot PRs:
"START COPILOT CODING AGENT"signature textlist_pull_requeststool and filter byuser.login == "Copilot"anduser.id == 198982749"Original prompt"which appears in Copilot PR descriptionsTesting
Verified the fix works correctly:
author:copilot-swe-agent→ 0 PRs found ❌"START COPILOT CODING AGENT"→ 881 PRs found ✅created:>=2025-10-15→ 142 PRs found ✅All unit tests pass (338 tests) and the workflow compiles successfully.
Changes
.github/workflows/copilot-agent-analysis.mdwith correct search strategiescopilot-swe-agenttoCopilot.lock.ymlfileWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://github.com/proxy/api.github.com/repos/githubnext/gh-aw/discussionscurl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.