Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/scripts/check_duplicate_prs/run
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,12 @@ main() {
echo "Processing PRs for issue references..."
debug_log "Starting to process $total_prs PRs for issue references"

# Process PRs one by one...
# Process PRs one by one, streaming the list through a single `jq` invocation in order to avoid re-parsing the entire list once per PR...
processed_count=0

for ((i=0; i<total_prs; i++)); do
pr=$(echo "$open_prs" | jq -c ".[$i]")

while IFS= read -r pr; do
if [ -z "$pr" ] || [ "$pr" = "null" ]; then
debug_log "Warning: Empty PR data at index $i"
debug_log "Warning: Empty PR data"
continue
fi

Expand Down Expand Up @@ -300,7 +298,7 @@ main() {
issue_prs_values[index]="${issue_prs_values[index]} $pr_number"
fi
done
done
done < <(echo "$open_prs" | jq -c '.[]')

debug_log "Finished processing all PRs for issue references"
debug_log "Found ${#issue_prs_keys[@]} unique issues referenced in PRs"
Expand Down