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 5, 2024
1 parent 0d5bc67 commit eb410b5
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
strategy:
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']

steps:
Expand Down Expand Up @@ -40,12 +39,18 @@ jobs:
image-report: 'report.json'
patched-tag: 'patched'
buildkit-version: 'v0.11.6'
# optional, default is latest
copa-version: '0.3.0'

- name: Convert Repository Name to Lowercase
id: lowercase
run: echo "::set-output name=name::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
- name: Modify Patched Image Names
id: modify_images
run: |
PATCHED_IMAGES=""
for image in "${{ matrix.images[@] }}"; do
# Modify image names based on your requirements
patched_image="docker.io/r3drun3/$(basename $image)-immunized"
PATCHED_IMAGES="$PATCHED_IMAGES $patched_image"
done
echo "patched_images=$PATCHED_IMAGES" >> $GITHUB_ENV
- name: Login to Docker Hub
if: steps.copa.conclusion == 'success'
Expand All @@ -55,13 +60,9 @@ jobs:
username: r3drun3
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker Push Patched Image
- name: Docker Push Patched Images
if: steps.login.conclusion == 'success'
run: |
original_image=${{ matrix.images }}
patched_image=$(echo $original_image | sed 's/docker.io\/library\//docker.io\/r3drun3\//')-patched
docker tag ${{ steps.copa.outputs.patched-image }} $patched_image
docker push $patched_image
for patched_image in $PATCHED_IMAGES; do
docker push $patched_image
done

0 comments on commit eb410b5

Please sign in to comment.