Skip to content

Commit 18596e9

Browse files
committed
build: ensure multi-line comment bodies are properly indented
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 8abdc55 commit 18596e9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/scripts/create_address_commit_comments_issues

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,12 @@ update_commit_map() {
248248
local endLine=$(( line + 3 ))
249249
local code_snippet="https://github.com/stdlib-js/stdlib/blob/${key}/${path}#L${startLine}-L${endLine}"
250250

251+
local formatted_body=$(echo "${body}" | sed $'s/\n/\n /g')
252+
251253
for existing in "${commit_keys[@]}"; do
252254
if [ "$existing" = "$key" ]; then
253255
commit_counts[i]=$(( commit_counts[i] + 1 ))
254-
commit_comments[i]="${commit_comments[i]}"$'\n\n'"- ${link}"$'\n\n'" > **Line ${line}**: ${body}"$'\n\n'" ${code_snippet}"
256+
commit_comments[i]="${commit_comments[i]}"$'\n\n'"- ${link}"$'\n\n'" > **Line ${line}**: ${formatted_body}"$'\n\n'" ${code_snippet}"
255257
found=1
256258
break
257259
fi
@@ -261,7 +263,7 @@ update_commit_map() {
261263
if [ "$found" -eq 0 ]; then
262264
commit_keys+=("$key")
263265
commit_counts+=("1")
264-
commit_comments+=("- ${link}"$'\n\n'" > **Line ${line}**: ${body}"$'\n\n'" ${code_snippet}")
266+
commit_comments+=("- ${link}"$'\n\n'" > **Line ${line}**: ${formatted_body}"$'\n\n'" ${code_snippet}")
265267
fi
266268
}
267269

@@ -350,7 +352,6 @@ main() {
350352
for comment in "${all_comments[@]}"; do
351353
# Extract the comment body:
352354
local comment_body=$(echo "$comment" | jq -r '.body')
353-
local comment_line=$(echo "$comment" | jq -r '.line')
354355

355356
# Check if the comment body contains '@stdlib-bot':
356357
if [[ "$comment_body" == *"@stdlib-bot"* ]]; then

0 commit comments

Comments
 (0)