Skip to content

Commit

Permalink
make regex stronger to match more tags
Browse files Browse the repository at this point in the history
  • Loading branch information
joejstuart committed Jul 22, 2024
1 parent ba1b630 commit bc4a4ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions hack/build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ tkn_bundle_push() {
function save_ref() {
local output
output="$(< /dev/stdin)"
echo "${output}"
local digest
digest="$(echo "${output}" | grep -Po '@\K(sha256:[a-f0-9]*)')"

Expand All @@ -69,7 +68,7 @@ if [ -z "$BUILD_TAG" ]; then
# At the step of converting tasks to Tekton catalog, this is only
# applied to non-task resources.
BUILD_TAG=$(date +"%Y-%m-%d-%H%M%S")
echo "BUILD_TAG is not defined, using $BUILD_TAG"
# echo "BUILD_TAG is not defined, using $BUILD_TAG"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion spec/hack/bundles_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ eval "$(shellspec - -c) exit 1"

check_tkn_push_url() {
while read -r line; do
if [[ "$line" == quay.io/* ]] && [[ ! "$line" =~ ([0-9]+\.[0-9]-1234)?@sha256:5678$ ]]; then
if [[ ! "$line" =~ ^quay\.io/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+:[0-9a-zA-Z\.-]+@sha256:[a-fA-F0-9]+$ ]]; then
return 1
fi
done
Expand Down

0 comments on commit bc4a4ed

Please sign in to comment.