Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/dependency-track-report/csaf_notification.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import smtplib
import ssl
from datetime import datetime, timezone
from email.utils import format_datetime
from email.message import EmailMessage
from pathlib import Path

Expand Down Expand Up @@ -29,13 +31,15 @@ def main():
os.environ.get("CSAF_FILE", "/tmp/csaf-vex.json")
)

notification_time = datetime.now(timezone.utc)

if not csaf_file.is_file():
raise SystemExit("CSAF report does not exist.")

message = EmailMessage()
message["From"] = email_from
message["To"] = email_to

message["Date"] = format_datetime(notification_time)
if new_count > 0 and state_change_count > 0:
subject = f"[{project_name}] Vulnerability report updated"
elif new_count > 0:
Expand Down
Loading