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 11, 2024
1 parent d6cf31e commit 87deda2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ 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', 'mcr.microsoft.com/dotnet/aspnet:7.0.15-alpine3.18',
'docker.io/library/golang:1.18.10', 'docker.io/library/node:18.17.1-slim', 'docker.io/library/rust:1.69.0']
images: ['mcr.microsoft.com/dotnet/aspnet:7.0.15-alpine3.18', 'docker.io/library/node:18.17.1-slim']
# images: ['docker.io/library/nginx:1.21.6', 'docker.io/openpolicyagent/opa:0.46.0', 'mcr.microsoft.com/dotnet/aspnet:7.0.15-alpine3.18',
# 'docker.io/library/golang:1.18.10', 'docker.io/library/node:18.17.1-slim', 'docker.io/library/rust:1.69.0']

steps:
- name: Set up Docker Buildx
Expand All @@ -37,11 +38,19 @@ jobs:
vuln_count=$(jq '.Results | length' "$report_file")
echo "vuln_count=$vuln_count" >> $GITHUB_OUTPUT
# - name: Set Tag
# id: set_tag
# run: |
# TAG=$(echo "${{ matrix.images }}" | cut -d':' -f2 | cut -d'/' -f2 | sed 's/[^0-9.]*//g')
# echo "PATCHED_TAG=$TAG-immunized" >> $GITHUB_ENV

- name: Set Tag
id: set_tag
run: |
TAG=$(echo "${{ matrix.images }}" | cut -d':' -f2 | cut -d'/' -f2 | sed 's/[^0-9.]*//g')
echo "PATCHED_TAG=$TAG-immunized" >> $GITHUB_ENV
TAG=$(echo "${{ matrix.images }}" | grep -oP '(?<=:).*' | grep -oP '^[^/]+')
IMMUNIZED_TAG="${TAG}-immunized"
echo "PATCHED_TAG=${IMMUNIZED_TAG}" >> $GITHUB_ENV
- name: Copa Action
if: steps.vuln_count.outputs.vuln_count != '0'
Expand Down
2 changes: 1 addition & 1 deletion send_mail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
print("Patched images:", patched_images)
current_timestamp = datetime.now().strftime('%Y-%m-%d')
# Prepare the HTML content
subject = 'IMMUNIZE: Patched Image Report'
subject = 'IMMUNIZE: OCI Images Patching Report'
html_body = '<h1>Patched Images 💉 {}</h1><ul>'.format(current_timestamp)
for image in patched_images:
html_body += f'<li>{image}</li>'
Expand Down

0 comments on commit 87deda2

Please sign in to comment.