Skip to content

Commit 8eb5ebd

Browse files
committed
Enhance daily code review agent by increasing limits on PR and issue retrieval, and improving timestamp comparisons for created and merged PRs.
1 parent 53de993 commit 8eb5ebd

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/daily-code-review.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ jobs:
4444
run: |
4545
echo "Fetching open PRs and issues with copilot-finds label..."
4646
47-
# Get open PRs with copilot-finds label
47+
# Get open PRs with copilot-finds label (--limit ensures we don't miss any)
4848
OPEN_PRS=$(gh pr list \
4949
--label "copilot-finds" \
5050
--state open \
51+
--limit 200 \
5152
--json title,url,headRefName,files \
5253
--jq '[.[] | {title: .title, url: .url, branch: .headRefName, files: [.files[].path]}]' \
5354
2>/dev/null || echo "[]")
@@ -56,22 +57,26 @@ jobs:
5657
OPEN_ISSUES=$(gh issue list \
5758
--label "copilot-finds" \
5859
--state open \
60+
--limit 200 \
5961
--json title,url,body \
6062
--jq '[.[] | {title: .title, url: .url}]' \
6163
2>/dev/null || echo "[]")
6264
6365
# Get recently merged PRs (last 14 days) with copilot-finds label
66+
# Use jq numeric timestamp comparison (fromdateiso8601) to avoid string/timezone issues
6467
RECENT_MERGED=$(gh pr list \
6568
--label "copilot-finds" \
6669
--state merged \
70+
--limit 200 \
6771
--json title,url,mergedAt,files \
68-
--jq '[.[] | select(.mergedAt > (now - 14*86400 | todate)) | {title: .title, url: .url, files: [.files[].path]}]' \
72+
--jq '[.[] | select((.mergedAt | fromdateiso8601) > (now - 14*86400)) | {title: .title, url: .url, files: [.files[].path]}]' \
6973
2>/dev/null || echo "[]")
7074
71-
# Get all open PRs by bots (last 30 days)
75+
# Get all open PRs by bots
7276
BOT_PRS=$(gh pr list \
7377
--author "app/github-actions" \
7478
--state open \
79+
--limit 200 \
7580
--json title,url,headRefName \
7681
--jq '[.[] | {title: .title, url: .url, branch: .headRefName}]' \
7782
2>/dev/null || echo "[]")
@@ -178,6 +183,7 @@ jobs:
178183
timeout --foreground --signal=TERM --kill-after=30s 1200s \
179184
copilot \
180185
--prompt "$FULL_PROMPT" \
186+
--model "claude-opus-4.6" \
181187
--allow-all-tools \
182188
--allow-all-paths \
183189
< /dev/null 2>&1 || EXIT_CODE=$?
@@ -204,12 +210,14 @@ jobs:
204210
echo "**Date:** $(date +%Y-%m-%d)" >> $GITHUB_STEP_SUMMARY
205211
echo "" >> $GITHUB_STEP_SUMMARY
206212
207-
# Count PRs created in this run
213+
# Count PRs created in this run using numeric timestamp comparison
214+
CUTOFF_EPOCH=$(date -d '1 hour ago' +%s)
208215
PR_COUNT=$(gh pr list \
209216
--label "copilot-finds" \
210217
--state open \
218+
--limit 200 \
211219
--json createdAt \
212-
--jq "[.[] | select(.createdAt > \"$(date -d '1 hour ago' -Iseconds)\")] | length" \
220+
--jq "[.[] | select((.createdAt | fromdateiso8601) > $CUTOFF_EPOCH)] | length" \
213221
2>/dev/null || echo "0")
214222
215223
echo "**PRs opened this run:** $PR_COUNT" >> $GITHUB_STEP_SUMMARY
@@ -220,8 +228,9 @@ jobs:
220228
gh pr list \
221229
--label "copilot-finds" \
222230
--state open \
231+
--limit 200 \
223232
--json title,url,createdAt \
224-
--jq ".[] | select(.createdAt > \"$(date -d '1 hour ago' -Iseconds)\") | \"- [\(.title)](\(.url))\"" \
233+
--jq ".[] | select((.createdAt | fromdateiso8601) > $CUTOFF_EPOCH) | \"- [\(.title)](\(.url))\"" \
225234
2>/dev/null >> $GITHUB_STEP_SUMMARY || true
226235
else
227236
echo "_No new findings today — codebase looking good! 🎉_" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)