Skip to content

Commit f230edc

Browse files
committed
adds back email sending
1 parent a26b455 commit f230edc

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

.github/workflows/weekly_clone_stats.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,34 @@ jobs:
5151
- name: Print raw JSON
5252
run: cat clone_stats.json
5353

54-
- name: Parse and Print Stats
54+
- name: Parse clone stats
5555
id: parse
5656
run: |
5757
COUNT=$(jq '.count' clone_stats.json)
5858
UNIQUES=$(jq '.uniques' clone_stats.json)
59-
echo "Total Clones: $COUNT"
60-
echo "Unique Cloners: $UNIQUES"
59+
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
60+
echo "uniques=$UNIQUES" >> "$GITHUB_OUTPUT"
61+
62+
- name: Send email
63+
uses: dawidd6/action-send-mail@v3
64+
with:
65+
# Replace with your SMTP server, port, and credentials
66+
server_address: smtp.sendgrid.net
67+
server_port: 587
68+
username: ${{ secrets.SMTP_USERNAME }}
69+
password: ${{ secrets.SMTP_PASSWORD }}
70+
subject: "📊 Weekly GitHub Clone Stats for ${{ github.repository }}"
71+
to: ${{ vars.EMAIL_TO }}
72+
from: ${{ vars.EMAIL_FROM }}
73+
# "text/html" is optional if you want to send as HTML
74+
content_type: text/plain
75+
secure: true
76+
body: |
77+
Hi,
78+
79+
Here are the clone stats for *${{ github.repository }}* this week:
80+
81+
🔁 Total Clones: ${{ steps.parse.outputs.count }}
82+
👤 Unique Cloners: ${{ steps.parse.outputs.uniques }}
83+
84+
– GitHub Bot

0 commit comments

Comments
 (0)