Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jul 29, 2024
1 parent 174e9f6 commit 66c3e39
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions .github/actions/scan-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}'

0 comments on commit 66c3e39

Please sign in to comment.