You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/close-failing-ci-prs.sh
+15-4Lines changed: 15 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,7 @@ build_guidance() {
250
250
return
251
251
fi
252
252
253
-
local guidance="\\n\\n**Failing checks and how to fix them:**\\n"
253
+
local guidance=$'\n\n**Failing checks and how to fix them:**\n'
254
254
local seen=""
255
255
256
256
IFS=','read -ra checks <<<"$failed_checks"
@@ -263,7 +263,8 @@ build_guidance() {
263
263
264
264
local fix
265
265
fix=$(get_check_guidance "$check")
266
-
guidance="${guidance}\\n- **${check}**: ${fix}"
266
+
guidance="${guidance}
267
+
- **${check}**: ${fix}"
267
268
done
268
269
269
270
echo"$guidance"
@@ -348,7 +349,12 @@ for pr in "${all_prs[@]}"; do
348
349
echo" ↳ CI failing for ${days_since} days -> CLOSING"
349
350
350
351
if [[ "$DRY_RUN"=="false" ]];then
351
-
comment_body="${WARNING_MARKER}\nThank you for your contribution @${pr_author}. Unfortunately, we are unable to review or merge this pull request as the CI checks have been failing for more than 14 days.\n\nPlease feel free to reopen this PR once the CI issues have been resolved.${guidance}\n\nThank you for your understanding!"
352
+
comment_body="${WARNING_MARKER}
353
+
Thank you for your contribution @${pr_author}. Unfortunately, we are unable to review or merge this pull request as the CI checks have been failing for more than 14 days.
354
+
355
+
Please feel free to reopen this PR once the CI issues have been resolved.${guidance}
356
+
357
+
Thank you for your understanding!"
352
358
353
359
# Use jq to safely build JSON
354
360
json_payload=$(jq -n --arg body "$comment_body"'{"body": $body}')
@@ -384,7 +390,12 @@ for pr in "${all_prs[@]}"; do
384
390
echo" ↳ CI failing for ${days_since} days -> WARNING"
385
391
386
392
if [[ "$DRY_RUN"=="false" ]];then
387
-
comment_body="${WARNING_MARKER}\nHi @${pr_author}, we have noticed that the CI on this pull request has been failing for 7 days.\n\nIf the CI failures are not resolved within the next 7 days, we will close this pull request.${guidance}\n\nIf you need help, please leave a comment and we will do our best to assist. Thank you!"
393
+
comment_body="${WARNING_MARKER}
394
+
Hi @${pr_author}, we have noticed that the CI on this pull request has been failing for 7 days.
395
+
396
+
If the CI failures are not resolved within the next 7 days, we will close this pull request.${guidance}
397
+
398
+
If you need help, please leave a comment and we will do our best to assist. Thank you!"
388
399
389
400
json_payload=$(jq -n --arg body "$comment_body"'{"body": $body}')
0 commit comments