mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-25 08:06:22 +02:00
Fix backfill pagination: use raw count instead of filtered count
The pagination loop was breaking early because it checked the count of jq-filtered results rather than the raw API response count.
This commit is contained in:
parent
5fa180744d
commit
e388e1b8b3
1 changed files with 3 additions and 3 deletions
6
.github/workflows/backfill-dedupe.yml
vendored
6
.github/workflows/backfill-dedupe.yml
vendored
|
|
@ -41,12 +41,12 @@ jobs:
|
|||
ISSUES=""
|
||||
PAGE=1
|
||||
while true; do
|
||||
RAW_COUNT=$(gh issue list --repo "$REPO" --state open --limit 100 --page "$PAGE" --json number | jq 'length')
|
||||
BATCH=$(gh issue list --repo "$REPO" --state open --limit 100 --page "$PAGE" --json number,labels,createdAt \
|
||||
--jq "[.[] | select(.createdAt >= \"$SINCE\") | select([.labels[].name] | index(\"duplicate\") | not)] | .[].number")
|
||||
|
||||
[ -z "$BATCH" ] && break
|
||||
ISSUES="$ISSUES $BATCH"
|
||||
[ $(echo "$BATCH" | wc -w) -lt 100 ] && break
|
||||
[ -n "$BATCH" ] && ISSUES="$ISSUES $BATCH"
|
||||
[ "$RAW_COUNT" -lt 100 ] && break
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
ISSUES=$(echo "$ISSUES" | xargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue