diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml index 445312b..040d472 100644 --- a/.github/workflows/semantic-release.yaml +++ b/.github/workflows/semantic-release.yaml @@ -77,6 +77,7 @@ jobs: for major in "${!latest[@]}"; do tag=${latest[$major]} [ "$(git rev-parse -q --verify "refs/tags/$major^{commit}")" = "$(git rev-parse "$tag^{commit}")" ] && continue + git rev-parse -q --verify "refs/tags/$major" >/dev/null && ! git merge-base --is-ancestor "refs/tags/$major^{commit}" "$tag^{commit}" && continue git tag --force "$major" "$tag" git push --force origin "refs/tags/$major" done diff --git a/semantic-release/action.yaml b/semantic-release/action.yaml index 6dd802f..092081a 100644 --- a/semantic-release/action.yaml +++ b/semantic-release/action.yaml @@ -66,6 +66,7 @@ runs: for major in "${!latest[@]}"; do tag=${latest[$major]} [ "$(git rev-parse -q --verify "refs/tags/$major^{commit}")" = "$(git rev-parse "$tag^{commit}")" ] && continue + git rev-parse -q --verify "refs/tags/$major" >/dev/null && ! git merge-base --is-ancestor "refs/tags/$major^{commit}" "$tag^{commit}" && continue git tag --force "$major" "$tag" git push --force origin "refs/tags/$major" done