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 5b1a15a commit 3ab1073
Showing 1 changed file with 26 additions and 38 deletions.
64 changes: 26 additions & 38 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '!README.md'

jobs:
test:
immunize:
runs-on: ubuntu-latest

strategy:
Expand All @@ -16,6 +16,10 @@ jobs:
# 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']

outputs:
# Expose the 'images' array as an output
images: ${{ matrix.images }}

steps:

- name: Checkout Repository
Expand Down Expand Up @@ -74,42 +78,26 @@ jobs:
run: |
docker push ghcr.io/r3drun3/immunize/${{ steps.copa.outputs.patched-image }}
# - name: Check GitHub Workspace Contents
# run: |
# ls -R $GITHUB_WORKSPACE
# shell: bash

# - name: Send Mail Report
# if: steps.login.conclusion == 'success'
# run: |
# PATCHED_IMAGES=${{ steps.copa.outputs.patched-image }}
# echo "PATCHED_IMAGES=${PATCHED_IMAGES}" >> $GITHUB_ENV
# 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

# 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
shell: bash

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

- name: Set PATCHED_IMAGES
id: set_patched_images
run: |
PATCHED_IMAGES=${{ steps.copa.outputs.patched-image }}
echo "PATCHED_IMAGES=${PATCHED_IMAGES}" >> $GITHUB_ENV
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 }}
PATCHED_IMAGES: ${{ needs.test.outputs.PATCHED_IMAGES }}
- 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 }}

0 comments on commit 3ab1073

Please sign in to comment.