Skip to content

Commit b998072

Browse files
authored
Add safe_image_name which will eval to something like docker.io-replicated-local-volume-provider, to make it easier for github code scan to track issues (#5296)
1 parent 7c47cd5 commit b998072

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ runs:
4848
IMAGE_TAG=$(echo "${{ inputs.image-ref }}" | cut -d':' -f2)
4949
[[ "$IMAGE_TAG" == "$IMAGE_NAME" ]] && IMAGE_TAG="latest"
5050
SAFE_NAME=$(echo "${IMAGE_NAME}-${IMAGE_TAG}" | sed 's/[\/:]/-/g')
51+
SAFE_IMAGE_NAME=$(echo "${IMAGE_NAME}" | sed 's/[\/:]/-/g')
52+
5153
{
5254
echo "image_name=${IMAGE_NAME}"
5355
echo "image_tag=${IMAGE_TAG}"
5456
echo "safe_name=${SAFE_NAME}"
57+
echo "safe_image_name=${SAFE_IMAGE_NAME}"
58+
5559
} >> "$GITHUB_OUTPUT"
5660
5761
- name: Scan image with Grype
@@ -146,7 +150,8 @@ runs:
146150
uses: github/codeql-action/upload-sarif@v3
147151
with:
148152
sarif_file: ${{ inputs.output-file }}
149-
category: '${{ inputs.category-prefix }}${{ steps.image_details.outputs.safe_name }}'
153+
category: '${{ inputs.category-prefix }}${{ steps.image_details.outputs.safe_image_name }}'
154+
150155

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

0 commit comments

Comments
 (0)