From f0c6ca19828ad88ea0b28b7f2171f2d3915ea7f3 Mon Sep 17 00:00:00 2001 From: jstuart Date: Mon, 22 Jul 2024 12:53:02 -0500 Subject: [PATCH] make regex stronger to match more tags --- hack/build-and-push.sh | 1 - spec/hack/bundles_spec.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/build-and-push.sh b/hack/build-and-push.sh index feb1880a05..6bdda849cc 100755 --- a/hack/build-and-push.sh +++ b/hack/build-and-push.sh @@ -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]*)')" diff --git a/spec/hack/bundles_spec.sh b/spec/hack/bundles_spec.sh index 3fe2a2925d..f699322b0f 100644 --- a/spec/hack/bundles_spec.sh +++ b/spec/hack/bundles_spec.sh @@ -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/* ]] && [[ ! "$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