Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sanitize Docker image tags to remove invalid characters #1967

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
elif [[ ${{ github.ref }} == refs/pull/* ]]; then
tag=pr-$(echo ${{ github.ref }} | cut -c11-|sed 's,/merge,,')
else
tag=$(echo ${{ github.ref_name }}|sed 's,/merge,,')
# Sanitize the tag by replacing invalid characters with hyphens
tag=$(echo ${{ github.ref_name }}|sed 's,/merge,,' | sed 's,[/.],-,g')
fi
for image in ./cmd/*;do
ko build -B -t "${tag}" --platform="${{ env.PLATFORMS }}" "${image}"
Expand Down