From cacb97a22c7b8c41c6b34017315e2d2d9ea673da Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Mon, 4 Dec 2023 14:24:34 +0100 Subject: [PATCH] Allow running of bumptag with out signed commits or tags By setting ALLOW_UNSIGNED_COMMITS_WITHOUT_TAGS you can bootstrap bumptag on first startup of new repo --- bump-tag | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bump-tag b/bump-tag index cf2c8ad..9352245 100755 --- a/bump-tag +++ b/bump-tag @@ -173,12 +173,15 @@ tag_list="$(git tag -l "${tagpfx}-*")" # shellcheck disable=SC2181 if [[ ${?} -ne 0 ]] || [[ -z "${tag_list}" ]]; then - echo "No tags found, verifying all commits instead." - # %H = commit hash - # %G? = show "G" for a good (valid) signature - git_log="$(git log --pretty="format:%H${t}%G?" \ - --first-parent \ - | grep -v "${t}G$")" + if [[ -z ${ALLOW_UNSIGNED_COMMITS_WITHOUT_TAGS} ]]; then + echo "No tags found, verifying all commits instead." + echo "Please set environment variable ALLOW_UNSIGNED_COMMITS_WITHOUT_TAGS if you want to disable this check." + # %H = commit hash + # %G? = show "G" for a good (valid) signature + git_log="$(git log --pretty="format:%H${t}%G?" \ + --first-parent \ + | grep -v "${t}G$")" + fi else