@@ -47,22 +47,36 @@ if $DIFF_FOUND; then
47
47
echo " Metric differences detected"
48
48
echo " DIFF_FOUND=true" >> " $GITHUB_OUTPUT "
49
49
50
+ # Calculate total changes across all files
51
+ total_changes=0
52
+ for summary_file in " ${summary_files[@]} " ; do
53
+ changes=$( grep " **Total Changes:**" " $summary_file " | awk ' {print $3}' )
54
+ total_changes=$(( total_changes + changes))
55
+ done
56
+
50
57
# Combine all summaries into one
51
- echo " ## Metrics Comparison Summary" > " $METRICS_DIR /combined_summary.md"
52
- echo " " >> " $METRICS_DIR /combined_summary.md"
58
+ combined_file=" $METRICS_DIR /combined_summary.md"
59
+ echo " ## Metrics Comparison Summary" > " $combined_file "
60
+ echo " " >> " $combined_file "
61
+ echo " Total changes across all snapshots: $total_changes " >> " $combined_file "
62
+ echo " " >> " $combined_file "
63
+ echo " <details>" >> " $combined_file "
64
+ echo " <summary>Detailed changes per snapshot</summary>" >> " $combined_file "
65
+ echo " " >> " $combined_file "
53
66
54
67
if [ ${# summary_files[@]} -gt 0 ]; then
55
68
for summary_file in " ${summary_files[@]} " ; do
56
69
echo " Appending $summary_file to combined summary"
57
70
{
58
71
echo " ### $( basename " $summary_file " .md) "
59
72
cat " $summary_file "
60
- } >> " $METRICS_DIR /combined_summary.md "
61
- echo " " >> " $METRICS_DIR /combined_summary.md "
73
+ } >> " $combined_file "
74
+ echo " " >> " $combined_file "
62
75
done
63
76
fi
64
77
65
- echo -e " \n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT )" >> " $METRICS_DIR /combined_summary.md"
78
+ echo " </details>" >> " $combined_file "
79
+ echo -e " \n\n➡️ [View full metrics file]($LINK_TO_ARTIFACT )" >> " $combined_file "
66
80
else
67
81
echo " No metric differences detected"
68
82
fi
0 commit comments