From 66c3e393402e7ebda06b0c3d3777ea70fee0afdb Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Mon, 29 Jul 2024 12:58:48 -0700 Subject: [PATCH] f --- .github/actions/scan-image/action.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/actions/scan-image/action.yml b/.github/actions/scan-image/action.yml index 9578eed64..e94654a9b 100644 --- a/.github/actions/scan-image/action.yml +++ b/.github/actions/scan-image/action.yml @@ -16,14 +16,9 @@ runs: id: image-id shell: bash run: | - image_id="${{ inputs.image-ref }}" - image_id=$(echo "$image_id" | cut -d'@' -f1) # remove digest - # make sure if there is only one colon it is not the port - if ! echo "$image_id" | rev | cut -d':' -f1 | rev | grep -q '/' ; then - image_id=$(echo "$image_id" | rev | cut -d':' -f2- | rev) # remove tag - fi - echo $image_id - echo "::set-output name=image-id::$(echo ${{ inputs.image-ref }} | cut -d@ -f2)" + cd ${{github.action_path}} + image_id=$(./image_id.sh '${{ inputs.image-ref }}') + echo "image_id=$image_id" >> $GITHUB_OUTPUT - name: Scan image uses: aquasecurity/trivy-action@0.24.0 @@ -48,4 +43,4 @@ runs: uses: github/codeql-action/upload-sarif@v3 with: sarif_file: trivy-results.sarif - category: 'image-scan:${{ steps.image-id.outputs.image-id }}' + category: 'image-scan:${{ steps.image-id.outputs.image_id }}'