File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,17 @@ while IFS= read -r line; do
42
42
done <<< " $output"
43
43
44
44
json_output+=" ]" # End the JSON array
45
-
46
- results=" $json_output "
47
-
48
45
echo " $json_output "
46
+ results=" $json_output "
49
47
50
48
# Loop through each job in the JSON output
51
49
echo " $results " | jq -c ' .[]' | while IFS= read -r item; do
52
50
job_status=$( echo " $item " | jq -r ' .status' )
53
51
exit_code=$( echo " $item " | jq -r ' .exit_code' )
54
52
md_path=$( echo " $item " | jq -r ' .md_path' )
53
+
54
+ echo " Processing $md_path " # Debug: show which file is being processed
55
+
55
56
# Determine badge color and label based on status
56
57
if [[ " $job_status " == " Completed" ]] && [[ " $exit_code " == " 0" ]]; then
57
58
badge_color=" green"
@@ -66,9 +67,10 @@ echo "$results" | jq -c '.[]' | while IFS= read -r item; do
66
67
67
68
# Check if the markdown file exists
68
69
if [ -f " $md_path " ]; then
70
+ echo " Found $md_path " # Debug: confirm the file exists
71
+
69
72
# Use sed to replace the existing badge URL
70
- # This regex matches the part of the URL up to the "Test-" label, followed by any text up to the last hyphen, which is presumed to be the color
71
- sed -i ' ' -E " s|(https://img.shields.io/badge/Test-[^-]+-[^-]+)([^)]*\))|$badge_url \2|" " $md_path "
73
+ sed -i -E " s|(https://img.shields.io/badge/Test-[^-]+-[^-]+)([^)]*\))|$badge_url \2|" " $md_path "
72
74
else
73
75
echo " Markdown file does not exist: $md_path "
74
76
fi
You can’t perform that action at this time.
0 commit comments