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 dcad823 commit c03f300
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 39 deletions.
48 changes: 14 additions & 34 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,39 +93,19 @@ jobs:
# name: outputs
# path: outputs/*.txt

# send-mail-report:
# runs-on: ubuntu-latest
# needs: immunize
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2

# - uses: actions/checkout@v3
# - name: Load outputs
# uses: actions/download-artifact@v3
# with:
# name: outputs
# path: outputs

# - run: |
# ls outputs
# cat outputs/*.txt

# # Access the 'images' array from the 'immunize' job outputs
# - name: Set PATCHED_IMAGES
# id: set_patched_images
# run: |
# IMAGES="${{ needs.immunize.outputs.images }}"
# echo "PATCHED_IMAGES=${IMAGES}" >> $GITHUB_ENV
# echo "Patched images: $IMAGES" # Print for debugging
# shell: bash

# - name: Send Mail Report
# run: |
# python $GITHUB_WORKSPACE/send_mail_report.py
# env:
# EMAIL_RECIPIENTS: ${{ secrets.EMAIL_RECIPIENTS }}
# EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }}
# EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
send-mail-report:
runs-on: ubuntu-latest
needs: immunize
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Send Mail Report
run: |
python $GITHUB_WORKSPACE/send_mail_report.py
env:
EMAIL_RECIPIENTS: ${{ secrets.EMAIL_RECIPIENTS }}
EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
# PATCHED_IMAGES: ${{ env.PATCHED_IMAGES }}

15 changes: 10 additions & 5 deletions send_mail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import os
import yaml

# Get patched image information from GitHub Actions context
patched_images_str = os.environ.get('PATCHED_IMAGES', '')
print("Pathed images string: ", patched_images_str)
patched_images = patched_images_str.split(',')
print("Pathed images: ", patched_images)
# Get the path to the 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
with open(yaml_file_path, 'r') as yaml_file:
yaml_content = yaml.load(yaml_file, Loader=yaml.FullLoader)
patched_images = yaml_content.get('jobs', {}).get('immunize', {}).get('strategy', {}).get('matrix', {}).get('images', [])

print("Patched images:", patched_images)

# Prepare the email content
subject = 'IMMUNIZE: Patched Image Report'
Expand Down

0 comments on commit c03f300

Please sign in to comment.