Skip to content

Commit e41de6b

Browse files
authored
use save_image_name in sarif upload category (#2130)
1 parent 72a11d5 commit e41de6b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/actions/scan-image/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ runs:
5555
IMAGE_TAG=$(echo "${{ inputs.image-ref }}" | cut -d':' -f2 | cut -d'@' -f1)
5656
[[ "$IMAGE_TAG" == "$IMAGE_NAME" ]] && IMAGE_TAG="latest"
5757
SAFE_NAME=$(echo "${IMAGE_NAME}-${IMAGE_TAG}" | sed 's/[\/:]/-/g')
58+
SAFE_IMAGE_NAME=$(echo "${IMAGE_NAME}" | sed 's/[\/:]/-/g')
5859
{
5960
echo "image_name=${IMAGE_NAME}"
6061
echo "image_tag=${IMAGE_TAG}"
6162
echo "safe_name=${SAFE_NAME}"
63+
echo "safe_image_name=${SAFE_IMAGE_NAME}"
64+
6265
} >> "$GITHUB_OUTPUT"
6366
6467
- name: Scan image with Grype
@@ -122,7 +125,8 @@ runs:
122125
uses: github/codeql-action/upload-sarif@v3
123126
with:
124127
sarif_file: ${{ inputs.output-file }}
125-
category: '${{ inputs.category-prefix }}${{ steps.image-id.outputs.image_id }}'
128+
category: '${{ inputs.category-prefix }}${{ steps.image_details.outputs.safe_image_name }}'
129+
126130

127131
- name: Archive scan results
128132
if: ${{ !cancelled() && inputs.upload-sarif == 'true' }}

0 commit comments

Comments
 (0)