diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04537ad..2ccd218 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,11 +35,17 @@ jobs: echo "::set-output name=content::$CHANGELOG_CONTENT" - - name: Create annotated tag with changelog + - name: Create or update annotated tag with changelog run: | TAG_NAME="${{ github.ref_name }}" CHANGELOG_CONTENT="${{ steps.changelog.outputs.content }}" + if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then + echo "Tag $TAG_NAME already exists. Updating tag message." + git tag -d "$TAG_NAME" + git push origin :"$TAG_NAME" + fi + git tag -a "$TAG_NAME" -m "$CHANGELOG_CONTENT" git push origin "$TAG_NAME"