Skip to content

Commit

Permalink
image-util.sh - Allow dot and hyphen in tag name (#90)
Browse files Browse the repository at this point in the history
The sanitization to clean the tag name should allow dots and hyphens.
Particularly because the sanitization runs on the git tag (e.g. v1.2.3).

Also, the tag can't start with a period or hyphen.
  • Loading branch information
andrewkroh authored Apr 15, 2024
1 parent f83b905 commit 6d3fb10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .buildkite/scripts/image-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ docker_branch_tag() {
# The tag must be valid ASCII and can contain lowercase and uppercase letters,
# digits, underscores, periods, and hyphens. It can't start with a period or
# hyphen and must be no longer than 128 characters.
branch_tag=${branch_tag//[^a-zA-Z0-9]/_}
branch_tag=${branch_tag//[^-.a-zA-Z0-9]/_}
branch_tag=${branch_tag/#[-.]/_}
branch_tag=${branch_tag:0:128}

echo "${image}:${branch_tag}"
Expand Down

0 comments on commit 6d3fb10

Please sign in to comment.