Skip to content

Commit 7048237

Browse files
fix(workflows): improve status table columns (#96)
## Summary - Fix score regex to match 'Claude | XX/100' format from AI reviews - Fix PR search to find PRs by library name in auto/ branches - Count attempts from sub-issue comments instead of labels ## Testing Trigger sync by updating a sub-issue label
1 parent 4ae4bd4 commit 7048237

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/bot-sync-status.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,19 @@ jobs:
166166
STATUS=":hourglass: Pending"
167167
fi
168168
169-
# Get quality score from sub-issue comments
169+
# Get quality score from sub-issue comments (format: | Claude | XX/100 | approve |)
170170
SCORE=$(gh api repos/${{ github.repository }}/issues/$SUB_ISSUE/comments \
171-
--jq '[.[] | .body | capture("\\*\\*Median\\*\\* \\| \\*\\*(?<score>\\d+)") | .score] | last // "-"' 2>/dev/null || echo "-")
171+
--jq '[.[] | .body | capture("Claude \\| (?<score>\\d+)/100") | .score] | last // "-"' 2>/dev/null || echo "-")
172172
173-
# Find PR for this library
174-
PR_NUM=$(gh pr list --search "implement ${{ steps.parent.outputs.spec_id || 'spec' }} in:title $LIB in:title" \
175-
--json number -q '.[0].number' 2>/dev/null || echo "")
173+
# Find PR for this library (search by library name in auto/ branches)
174+
PR_NUM=$(gh pr list --head "auto/" --search "$LIB" \
175+
--json number,headRefName -q '.[] | select(.headRefName | contains("'"$LIB"'")) | .number' 2>/dev/null | head -1 || echo "")
176176
PR_LINK=$([[ -n "$PR_NUM" ]] && echo "#$PR_NUM" || echo "-")
177177
178-
# Count attempts from labels
179-
ATTEMPTS=0
180-
if echo "$LABELS" | grep -q "ai-attempt-1"; then ATTEMPTS=1; fi
181-
if echo "$LABELS" | grep -q "ai-attempt-2"; then ATTEMPTS=2; fi
182-
if echo "$LABELS" | grep -q "ai-attempt-3"; then ATTEMPTS=3; fi
178+
# Count attempts from sub-issue comments
179+
ATTEMPTS=$(gh api repos/${{ github.repository }}/issues/$SUB_ISSUE/comments \
180+
--jq '[.[] | .body | select(startswith("## Attempt"))] | length' 2>/dev/null || echo "0")
181+
[[ -z "$ATTEMPTS" ]] && ATTEMPTS=0
183182
184183
echo "| $LIB | $STATUS | $SCORE | $PR_LINK | $ATTEMPTS/3 |" >> /tmp/status_table.md
185184
done

0 commit comments

Comments
 (0)