Skip to content

Commit

Permalink
use github.repository
Browse files Browse the repository at this point in the history
  • Loading branch information
gotsysdba committed Dec 1, 2023
1 parent ab23b1f commit 9fa3bd7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/obaas-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Get latest Image Software Digest
run: |
latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest /image_digest)
latest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository }}/${{ env.dst_img }}:latest /image_digest)
echo "Current Digest: $latest_digest"
echo "latest_digest=$latest_digest" >> $GITHUB_ENV
continue-on-error: true
Expand All @@ -37,7 +37,7 @@ jobs:
uses: ./.github/actions/process-image
with:
src_image: container-registry.oracle.com/graalvm/native-image:${{ env.src_tag }}
dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
dst_image: ghcr.io/${{ github.repository }}/${{ env.dst_img }}:${{ env.src_tag }}
description: ${{ env.description }}
push: true

Expand All @@ -51,32 +51,32 @@ jobs:
docker run --rm ghcr.io/aquasecurity/trivy:latest image $TRIVY_DEFAULT $TRIVY_SCAN
--username ${{ github.actor }}
--password ${{ secrets.GITHUB_TOKEN }}
ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
ghcr.io/${{ github.repository }}/${{ env.dst_img }}:latest
continue-on-error: true

- name: Update Existing Image
id: update_image
if: env.latest_digest != '' && steps.trivy_scan.outcome == 'failure'
uses: ./.github/actions/process-image
with:
src_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
src_image: ghcr.io/${{ github.repository }}/${{ env.dst_img }}:latest
dst_image: ghcr.io/${{ github.repository }}/${{ env.dst_img }}:${{ env.src_tag }}
description: ${{ env.description }}
push: false

- name: Get newest Image Software Digest
id: get_newest_digest
if: steps.update_image.outcome != 'skipped'
run: |
newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest /image_digest)
newest_digest=$(docker run --rm --entrypoint cat ghcr.io/${{ github.repository }}/${{ env.dst_img }}:latest /image_digest)
echo "New Digest: $newest_digest"
echo "newest_digest=$newest_digest" >> $GITHUB_ENV
- name: Push Updated Image
if: steps.get_newest_digest.outcome != 'skipped' && env.latest_digest != env.newest_digest
uses: ./.github/actions/process-image
with:
src_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:latest
dst_image: ghcr.io/${{ github.repository_owner }}/${{ env.dst_img }}:${{ env.src_tag }}
src_image: ghcr.io/${{ github.repository }}/${{ env.dst_img }}:latest
dst_image: ghcr.io/${{ github.repository }}/${{ env.dst_img }}:${{ env.src_tag }}
description: ${{ env.description }}
push: true

0 comments on commit 9fa3bd7

Please sign in to comment.