Skip to content

Commit 7135273

Browse files
committed
feat: send summary as code block
1 parent c49d3fd commit 7135273

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

alerts/generate_send_summary.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,19 @@ if [[ -f "$LOG_FILE" ]]; then
115115
printf "Daily Proof Submission Summary\n"
116116
printf "From %s 00:00 to %s 23:59\n" "$DATE" "$DATE"
117117
echo "----------------------------------------------------"
118-
printf "Processed batches: %d\n" "$batches"
119-
printf "Total Proofs submitted: %d\n" "$submitted_total"
120-
printf "Total Proofs verified: %d\n" "$verified_total"
121-
printf "Total Proofs not verified: %d\n" "$unverified_total"
122-
printf "Proofs submitted by Aligned: %d\n" "$submitted_by_aligned"
123-
printf "Proofs submitted by 3rd parties: %d\n" "$((submitted_total - submitted_by_aligned))"
124-
printf "Spent by Aligned (ETH): %.12f ETH\n" "$eth_by_aligned"
125-
printf "Spent by Aligned (USD): $ %.2f\n" "$usd_by_aligned"
126-
printf "Spent by 3rd parties (ETH): %.12f ETH\n" "$(echo "$eth_total - $eth_by_aligned" | bc -l)"
127-
printf "Spent by 3rd parties (USD): $ %.2f\n" "$(echo "$usd_total - $usd_by_aligned" | bc -l)"
128-
printf "Total spent (ETH): %.12f ETH\n" "$eth_total"
129-
printf "Total spent (USD): $ %.2f\n" "$usd_total"
118+
printf "Processed batches: %d\n" "$batches"
119+
printf "Total Proofs submitted: %d\n" "$submitted_total"
120+
printf "Total Proofs verified: %d\n" "$verified_total"
121+
printf "Total Proofs not verified: %d\n" "$unverified_total"
122+
printf "Submitted by Aligned: %d\n" "$submitted_by_aligned"
123+
printf "Submitted by 3rd parties: %d\n" "$((submitted_total - submitted_by_aligned))"
124+
echo "----------------------------------------------------"
125+
printf "Spent by Aligned (ETH): %.12f ETH\n" "$eth_by_aligned"
126+
printf "Spent by Aligned (USD): $ %.2f\n" "$usd_by_aligned"
127+
printf "Spent by 3rd parties (ETH): %.12f ETH\n" "$(echo "$eth_total - $eth_by_aligned" | bc -l)"
128+
printf "Spent by 3rd parties (USD): $ %.2f\n" "$(echo "$usd_total - $usd_by_aligned" | bc -l)"
129+
printf "Total spent (ETH): %.12f ETH\n" "$eth_total"
130+
printf "Total spent (USD): $ %.2f\n" "$usd_total"
130131
echo "----------------------------------------------------"
131132
)
132133

@@ -136,7 +137,7 @@ if [[ -f "$LOG_FILE" ]]; then
136137
if [[ -n "$SLACK_WEBHOOK_URL" ]]; then
137138
safe_summary=$(printf '%s\n' "$summary" | sed 's/"/\\"/g')
138139
curl -s -X POST -H 'Content-type: application/json' \
139-
--data "{\"text\":\"$safe_summary\"}" \
140+
--data "{\"text\":\"\`\`\`$safe_summary\`\`\`\"}" \
140141
"$SLACK_WEBHOOK_URL" >/dev/null 2>&1
141142
fi
142143
else

0 commit comments

Comments
 (0)