Skip to content

Commit 40cd0e1

Browse files
authored
Fix check for release tag (#4871)
The original check checks whether the tag *exists* in the local and then tries to remove it from the public repo. However, it's possible that the tag is in the private repo, where it might not exists (refs from both remotes are present locally). This commit fixes this by explicitly check if the tag exists in the public repo and only then will it try to delete it.
1 parent 541b110 commit 40cd0e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

buildspecs/release-to-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ phases:
2222
-
2323
- git remote add --fetch public $PUBLIC_REPOSITORY_URL
2424
- |
25-
if git show-ref --tags $RELEASE_VERSION --quiet; then
25+
if [ `git ls-remote --tags public | grep refs/tags/$RELEASE_VERSION | wc -l` -ge "1" ]; then
2626
git push -d public :refs/tags/$RELEASE_VERSION
2727
fi
2828
- git tag -a $RELEASE_VERSION -m "AWS SDK for Java v2 ($RELEASE_VERSION)"

0 commit comments

Comments
 (0)