Skip to content

Commit 6d63d37

Browse files
committed
build: refactor to avoid broken pipe when processing PRs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: passed - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 3275ec2 commit 6d63d37

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/scripts/check_duplicate_prs

+8-5
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ main() {
169169
# Process each PR to build issue mappings:
170170
echo "Processing PRs for issue references..."
171171
pr_count=0
172-
while IFS= read -r pr; do
172+
173+
total_prs=$(echo "$open_prs" | jq 'length')
174+
for i in $(seq 0 $((total_prs-1))); do
175+
pr=$(echo "$open_prs" | jq -c ".[$i]")
173176
pr_number=$(echo "$pr" | jq -r '.number')
174177
pr_body=$(echo "$pr" | jq -r '.body')
175178
resolved_issues=$(extract_resolved_issues "$pr_body")
@@ -182,9 +185,9 @@ main() {
182185
for issue in $resolved_issues; do
183186
# Find existing issue index
184187
index=-1
185-
for i in "${!issue_prs_keys[@]}"; do
186-
if [ "${issue_prs_keys[$i]}" = "$issue" ]; then
187-
index=$i
188+
for j in "${!issue_prs_keys[@]}"; do
189+
if [ "${issue_prs_keys[$j]}" = "$issue" ]; then
190+
index=$j
188191
break
189192
fi
190193
done
@@ -195,7 +198,7 @@ main() {
195198
issue_prs_values[index]="${issue_prs_values[index]} $pr_number"
196199
fi
197200
done
198-
done < <(echo "${open_prs}" | jq -c '.[]')
201+
done
199202

200203
# Process the mappings to find duplicates:
201204
declare -a should_be_labeled_list

0 commit comments

Comments
 (0)