From 2d57c056c575f7a08fa5862ead79b6dfe9caecc6 Mon Sep 17 00:00:00 2001 From: r3drun3 Date: Wed, 10 Jan 2024 20:17:46 +0100 Subject: [PATCH] ci: test Signed-off-by: r3drun3 --- .github/workflows/patch.yaml | 2 +- send_mail_report.py | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/patch.yaml b/.github/workflows/patch.yaml index 4dcb550..5d1c724 100644 --- a/.github/workflows/patch.yaml +++ b/.github/workflows/patch.yaml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: # provide relevant list of images to scan on each run - images: ['docker.io/library/nginx:1.21.6', 'docker.io/openpolicyagent/opa:0.46.0'] + images: ['docker.io/library/nginx:1.21.6', 'docker.io/openpolicyagent/opa:0.46.0', 'docker.io/python:3.9.18-slim-bullseye'] # outputs: # # Expose the 'images' array as an output diff --git a/send_mail_report.py b/send_mail_report.py index cd14690..1613ac5 100644 --- a/send_mail_report.py +++ b/send_mail_report.py @@ -1,12 +1,12 @@ -import smtplib -from email.mime.text import MIMEText -from email.mime.multipart import MIMEMultipart import os import yaml -#import html +import smtplib from datetime import datetime +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart + -# Get the path to the YAML file +# Get the path to the Github Action YAML file yaml_file_path = os.path.join(os.path.dirname(__file__), '.github/workflows/patch.yaml') # Read the YAML file to get the patched image list @@ -15,17 +15,14 @@ patched_images = yaml_content.get('jobs', {}).get('immunize', {}).get('strategy', {}).get('matrix', {}).get('images', []) print("Patched images:", patched_images) -# Get the current timestamp -current_timestamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') +current_timestamp = datetime.now().strftime('%Y-%m-%d') # Prepare the HTML content subject = 'IMMUNIZE: Patched Image Report' -html_body = '

Patched Images 💉- {}