Simplify copilot-agent-analysis workflow using gh search prs --author "@copilot"#2028
Simplify copilot-agent-analysis workflow using gh search prs --author "@copilot"#2028
Conversation
…entation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ations Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Excellent discovery! 🎉 I investigated Key Finding
Recommended ApproachInstead of the current gh search prs --repo "${{ github.repository }}" \
--author "@copilot" \
--created ">=$DATE_30_DAYS_AGO" \
--limit 1000 \
--json number,title,state,createdAt,closedAt,author,body,labels,url,assigneesThis eliminates the need for jq filtering and is simpler and more efficient. Updated FilesCreated Commit: 6da7a74 → (new commit being pushed) |
|
@copilot update copilot agent analyzis with best approach found. Only use one way to search copilot PRs. |
…instead of jq filtering Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated the copilot-agent-analysis workflow to use the best approach found: Changes MadeSimplified from 2 commands to 1: Before: gh search prs repo:$REPO created:">=$DATE" --limit 1000 > raw.json
jq '[.[] | select(.author.login == "Copilot")]' raw.json > copilot-prs.jsonAfter: gh search prs --repo $REPO --author "@copilot" --created ">=$DATE" --limit 1000 > copilot-prs.jsonBenefits:
Updated both the workflow step and documentation to use only this approach. Commit: aa7ac2b → (new commit) |
| @@ -0,0 +1,155 @@ | |||
| # Additional Investigation: `gh search prs --author "@copilot"` | |||
There was a problem hiding this comment.
Removed GH_SEARCH_PRS_AUTHOR_INVESTIGATION.md
Commit: (being pushed)
| @@ -0,0 +1,297 @@ | |||
| # Investigation Report: `gh pr list --author "@copilot"` | |||
There was a problem hiding this comment.
Removed INVESTIGATION_REPORT.md
Commit: (being pushed)
| @@ -0,0 +1,146 @@ | |||
| # Investigation Complete: `gh pr list --author "@copilot"` and `gh search prs --author "@copilot"` | |||
There was a problem hiding this comment.
Removed SUMMARY.md
Commit: (being pushed)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| if [ "$COUNT7" -gt 0 ]; then | ||
| echo "" | ||
| echo "⚠️ Current approach (gh search prs + jq) works but is more complex" | ||
| echo " - Consider switching to gh search prs --author" |
There was a problem hiding this comment.
Removed .github/workflows/test-copilot-pr-list.yml
Commit: (being pushed)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Agentic Changeset Generator triggered by this pull request. |
Overview
This PR simplifies the copilot-agent-analysis workflow by replacing the
gh search prs + jqapproach withgh search prs --author "@copilot", which provides built-in server-side author filtering.Workflow Update
The copilot-agent-analysis workflow has been updated to use
gh search prs --author "@copilot"Before (2 commands):
After (1 command):
Benefits:
Key Discovery
gh search prssupports an--authorflag that provides server-side filtering for both date and author, combining efficiency with simplicity. This works for bot accounts including the Copilot bot (user ID 198982749).Valid Syntaxes
All of these command variations work correctly:
Comparison
gh pr list --authorgh search prs --author(implemented)gh search prs+ jq (old)Changes Made
Workflow Implementation
.github/workflows/copilot-agent-analysis.md- Updated to usegh search prs --author "@copilot"instead ofgh search prs + jq.github/workflows/copilot-agent-analysis.lock.yml- Recompiled with updated workflowpkg/cli/gh_pr_list_test.go- Unit tests documenting valid syntaxes and approach differencesTesting
All unit tests pass ✅
Conclusion
The copilot-agent-analysis workflow now uses
gh search prs --author "@copilot", which is simpler and more efficient than the previousgh search prs + jqapproach, eliminating the need for manual jq filtering.Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.