Skip to content

Commit 7c68cd2

Browse files
committed
Fix trivy scan image name
1 parent aa27c56 commit 7c68cd2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,15 @@ jobs:
9191
id: scan-tag
9292
if: github.event_name != 'pull_request'
9393
run: |
94+
# Lowercase the image name (Docker registries require lowercase)
95+
IMAGE_NAME_LOWER=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
96+
9497
# Use the version tag if this is a tag push, otherwise use latest
9598
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
9699
TAG="${GITHUB_REF#refs/tags/}"
97-
SCAN_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG#v}"
100+
SCAN_TAG="${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:${TAG#v}"
98101
else
99-
SCAN_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
102+
SCAN_TAG="${{ env.REGISTRY }}/${IMAGE_NAME_LOWER}:latest"
100103
fi
101104
echo "tag=$SCAN_TAG" >> $GITHUB_OUTPUT
102105
echo "Scanning image: $SCAN_TAG"

0 commit comments

Comments
 (0)