Merge pull request #481 from flatcar/krnowak/stricter-version-check

ci-automation: Implement a stricter image version check
This commit is contained in:
Krzesimir Nowak 2022-09-19 12:15:20 +02:00 committed by GitHub
commit 898f1b201e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,8 +32,8 @@ function update_submodule() {
function check_version_string() { function check_version_string() {
local version="$1" local version="$1"
if ! echo "${version}" | grep -qE '^(main-|alpha-|beta-|stable-|lts-)' ; then if [[ ! "${version}" =~ ^(main|alpha|beta|stable|lts)-[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "ERROR: invalid version '${version}', must start with 'main-', 'alpha-', 'beta-', 'stable-', or 'lts-'" echo "ERROR: invalid version '${version}', must start with 'main', 'alpha', 'beta', 'stable' or 'lts', followed by a dash and three dot-separated numbers, optionally followed by a dash and a non-empty build ID"
exit 1 exit 1
fi fi
} }