mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-24 23:56:21 +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=""
|
ISSUES=""
|
||||||
PAGE=1
|
PAGE=1
|
||||||
while true; do
|
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 \
|
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")
|
--jq "[.[] | select(.createdAt >= \"$SINCE\") | select([.labels[].name] | index(\"duplicate\") | not)] | .[].number")
|
||||||
|
|
||||||
[ -z "$BATCH" ] && break
|
[ -n "$BATCH" ] && ISSUES="$ISSUES $BATCH"
|
||||||
ISSUES="$ISSUES $BATCH"
|
[ "$RAW_COUNT" -lt 100 ] && break
|
||||||
[ $(echo "$BATCH" | wc -w) -lt 100 ] && break
|
|
||||||
PAGE=$((PAGE + 1))
|
PAGE=$((PAGE + 1))
|
||||||
done
|
done
|
||||||
ISSUES=$(echo "$ISSUES" | xargs)
|
ISSUES=$(echo "$ISSUES" | xargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue