From 5a5d142c452f9e2ae45d7923c4f7c7bb7be53f3c Mon Sep 17 00:00:00 2001 From: John Norwood Date: Mon, 8 Jul 2024 11:11:53 +0100 Subject: [PATCH] fix: Adds check for tag format to release script, also makes release script error on improper tags --- .github/workflows/release.yml | 2 +- release.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fb7ed3..c154853 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - "*" + - "v*" jobs: release: diff --git a/release.sh b/release.sh index b9cdcaa..c8ffab1 100755 --- a/release.sh +++ b/release.sh @@ -8,6 +8,11 @@ function main { exit 1 fi + if ! [[ "${release_version}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Release version must be of the form 'v1.2.3'" + exit 1 + fi + git commit -am "Release ${release_version}" --allow-empty git cliff --tag "${release_version}" -o git commit --amend -a