Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
Signed-off-by: r3drun3 <[email protected]>
  • Loading branch information
R3DRUN3 committed Jan 10, 2024
1 parent dad7ace commit 4da7863
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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', 'python:3.9.18-slim-bullseye']

outputs:
# Expose the 'images' array as an output
Expand Down
17 changes: 10 additions & 7 deletions send_mail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from email.mime.multipart import MIMEMultipart
import os
import yaml
import html
#import html
from datetime import datetime

# Get the path to the YAML file
yaml_file_path = os.path.join(os.path.dirname(__file__), '.github/workflows/patch.yaml')
Expand All @@ -14,15 +15,17 @@
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')
# Prepare the HTML content
subject = 'IMMUNIZE: Patched Image Report'
html_body = '<h2>Patched Images:</h2><ul>'
html_body = '<h2>Patched Images 💉- {}</h2><ul>'.format(current_timestamp)
for image in patched_images:
encoded_image_name = html.escape(image)
github_link = f'https://github.com/r3drun3/pkgs/container/immunize/{encoded_image_name}'
html_body += f'<li><a href="{github_link}">{encoded_image_name}</a></li>'
html_body += '</ul>'
# encoded_image_name = html.escape(image)
github_link = f'https://github.com/r3drun3/pkgs/container/immunize/{image}'
html_body += f'<li>{image}</li>'
html_body += '</ul><br />'
html_body += 'check the full catalog <a href="https://github.com/R3DRUN3?tab=packages&repo_name=immunize">here</a>'

# Get email and password from GitHub secrets
email_address = os.environ.get('EMAIL_ADDRESS', '')
Expand Down

0 comments on commit 4da7863

Please sign in to comment.