From ee9a60ab69d79918ea728489beab71138a37d3ca Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Sun, 15 Dec 2024 13:58:07 +0530 Subject: [PATCH] fix: image scan issue with github branch name --- .github/workflows/publish-backoffice.yml | 4 +++- .github/workflows/publish-kyb-app.yml | 4 +++- .github/workflows/publish-workflows-dashboard.yml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-backoffice.yml b/.github/workflows/publish-backoffice.yml index 509f3c8460..792ae3d002 100644 --- a/.github/workflows/publish-backoffice.yml +++ b/.github/workflows/publish-backoffice.yml @@ -64,6 +64,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=${{ github.head_ref || github.ref_name }} + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-${{ github.head_ref || github.ref_name }} type=raw,value=${{ steps.get_version.outputs.version }}-${{ github.head_ref || github.ref_name }} @@ -86,6 +87,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=prod + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-prod type=raw,value=${{ steps.get_version.outputs.version }}-prod type=raw,value=latest @@ -104,7 +106,7 @@ jobs: - name: Scan Docker Image uses: aquasecurity/trivy-action@master with: - image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' + image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}' format: 'table' ignore-unfixed: true exit-code: 1 diff --git a/.github/workflows/publish-kyb-app.yml b/.github/workflows/publish-kyb-app.yml index b835d08489..bfaf1c5daa 100644 --- a/.github/workflows/publish-kyb-app.yml +++ b/.github/workflows/publish-kyb-app.yml @@ -71,6 +71,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=${{ github.head_ref || github.ref_name }} + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-${{ github.head_ref || github.ref_name }} type=raw,value=${{ steps.get_version.outputs.version }}-${{ github.head_ref || github.ref_name }} @@ -93,6 +94,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=prod + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-prod type=raw,value=${{ steps.get_version.outputs.version }}-prod type=raw,value=latest @@ -110,7 +112,7 @@ jobs: - name: Scan Docker Image uses: aquasecurity/trivy-action@master with: - image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' + image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha}}' format: 'table' ignore-unfixed: true exit-code: 1 diff --git a/.github/workflows/publish-workflows-dashboard.yml b/.github/workflows/publish-workflows-dashboard.yml index 33ce363a98..3b14c55f1a 100644 --- a/.github/workflows/publish-workflows-dashboard.yml +++ b/.github/workflows/publish-workflows-dashboard.yml @@ -64,6 +64,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=${{ github.head_ref || github.ref_name }} + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-${{ github.head_ref || github.ref_name }} type=raw,value=${{ steps.get_version.outputs.version }}-${{ github.head_ref || github.ref_name }} @@ -86,6 +87,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=prod + type=raw,value=${{ github.sha}} type=raw,value=commit-${{ github.sha }}-prod type=raw,value=${{ steps.get_version.outputs.version }}-prod type=raw,value=latest @@ -103,7 +105,7 @@ jobs: - name: Scan Docker Image uses: aquasecurity/trivy-action@master with: - image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.head_ref || github.ref_name }}' + image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha}}' format: 'table' ignore-unfixed: true exit-code: 1