Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
Signed-off-by: r3drun3 <simone.ragonesi@sighup.io>
  • Loading branch information
R3DRUN3 committed Feb 6, 2024
1 parent ae07d65 commit 14d4341
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions send_mail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Prepare the HTML content
current_timestamp = datetime.now().strftime('%Y-%m-%d')
subject = 'IMMUNIZE: OCI Images Patching Report'
html_body = f'<h1>Patched Images πŸ’‰ {current_timestamp}</h1>'
html_body = f'<h1>Patched Images πŸ’‰ {current_timestamp}</h1><ul>'

# Get email and password from GitHub secrets
email_address = os.environ.get('EMAIL_ADDRESS', '')
Expand All @@ -32,6 +32,7 @@

# Iterate through report directories
for report_dir in report_directories:
html_body += f'<li>Files in {report_dir}:</li>'
report_dir_path = os.path.join(script_directory, report_dir)
# Get all files in the report directory
report_files = [filename for filename in os.listdir(report_dir_path) if os.path.isfile(os.path.join(report_dir_path, filename))]
Expand All @@ -41,8 +42,9 @@
part = MIMEApplication(file.read(), Name=os.path.basename(report_file))
part['Content-Disposition'] = f'attachment; filename="{report_file}"'
message.attach(part)
html_body += f'<li>{report_file}</li>'

html_body += '<br />'
html_body += '</ul><br />'
html_body += 'check the full catalog πŸ“š <a href="https://github.com/R3DRUN3?tab=packages&repo_name=immunize">here</a> !'
html_body += '<br /><br />'
html_body += '<h2>Stay Safe! πŸ’ͺ</h2>'
Expand Down

0 comments on commit 14d4341

Please sign in to comment.