diff --git a/buildspecs/release-to-github.yml b/buildspecs/release-to-github.yml index 955c4760da44..332bc1298fbe 100644 --- a/buildspecs/release-to-github.yml +++ b/buildspecs/release-to-github.yml @@ -22,7 +22,7 @@ phases: - - git remote add --fetch public $PUBLIC_REPOSITORY_URL - | - if git show-ref --tags $RELEASE_VERSION --quiet; then + if [ `git ls-remote --tags public | grep refs/tags/$RELEASE_VERSION | wc -l` -ge "1" ]; then git push -d public :refs/tags/$RELEASE_VERSION fi - git tag -a $RELEASE_VERSION -m "AWS SDK for Java v2 ($RELEASE_VERSION)"