From 3ab1073b03e800512f64a82046c123f6bde5aa88 Mon Sep 17 00:00:00 2001 From: r3drun3 Date: Wed, 10 Jan 2024 17:03:22 +0100 Subject: [PATCH] ci: test Signed-off-by: r3drun3 --- .github/workflows/patch.yaml | 64 +++++++++++++++--------------------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/.github/workflows/patch.yaml b/.github/workflows/patch.yaml index f4db957..4c1c52a 100644 --- a/.github/workflows/patch.yaml +++ b/.github/workflows/patch.yaml @@ -7,7 +7,7 @@ on: - '!README.md' jobs: - test: + immunize: runs-on: ubuntu-latest strategy: @@ -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 @@ -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 }}