Skip to content

Commit 52172a6

Browse files
committed
Update weekly auto notify workflow to run the correct script
1 parent 9645c40 commit 52172a6

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/run_weekly_auto_notify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
SENDER_EMAIL: ${{ secrets.SENDER_EMAIL }}
2727
SENDER_PASSWORD: ${{ secrets.SENDER_PASSWORD }}
2828
RECIPIENT_EMAIL: ${{ secrets.RECIPIENT_EMAIL }}
29-
run: python auto_notify.py
29+
run: python auto_notify_weekly.py

auto_notify_weekly.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from check_date import check_expiry
2+
from email_send import send_expiry_alert_email
3+
4+
def main():
5+
XML_FILE = "data.xml"
6+
DAYS_THRESHOLD = 30
7+
8+
print("\nChecking expiration dates...")
9+
near_expiry_list = check_expiry(XML_FILE, DAYS_THRESHOLD)
10+
11+
print("\nSending email if needed...")
12+
if not send_expiry_alert_email(near_expiry_list):
13+
print("Failed to send email (if needed).")
14+
15+
print("\nProcess completed.")
16+
17+
if __name__ == "__main__":
18+
main()

0 commit comments

Comments
 (0)