diff --git a/.github/scripts/check_tag_does_not_exist.sh b/.github/scripts/check_tag_does_not_exist.sh new file mode 100755 index 00000000..a0618fa1 --- /dev/null +++ b/.github/scripts/check_tag_does_not_exist.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# This script checks that the TAG arg does not exist, already. + +TAG="$1" + +if [ $(git tag -l $TAG) ]; then + echo "Error; tag $TAG already exists" + exit 1 +else + echo "tag $TAG does not exist" +fi diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 010c282a..fa984cf6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -24,6 +24,9 @@ jobs: - name: Verify that the current branch has a name that starts with 'release-' run: .github/scripts/verify_is_on_release_branch.sh + - name: Verify that the desired release tag does not already exist + run: .github/scripts/check_tag_does_not_exist.sh + create-draft: name: Create draft release needs: verify-head-status