Skip to content

Commit

Permalink
fix: removed move tag job so that if there's no need for a version up…
Browse files Browse the repository at this point in the history
…date the tag will not be moved
  • Loading branch information
frg committed Oct 12, 2023
1 parent 581fed2 commit 12af831
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,24 @@ jobs:
git config --local user.name "GitHub Action"
git commit -am "chore: 🔧 updated version to $VERSION"
git push
fi
- name: Move tag
run: |
# Delete the old tag locally
git tag -d ${{ github.event.release.tag_name }}
CURRENT_TAG_HASH=git rev-parse ${{ github.event.release.tag_name }}^{commit}
echo "Moving tag '${{ github.event.release.tag_name }}' to commit '$(git rev-parse HEAD)' from commit '${CURRENT_TAG_HASH}'"
# Delete the old tag from the remote repository
git push origin :${{ github.event.release.tag_name }}
# Delete the old tag locally
git tag -d ${{ github.event.release.tag_name }}
# Create a new tag at the current commit
git tag ${{ github.event.release.tag_name }}
# Delete the old tag from the remote repository
git push origin :${{ github.event.release.tag_name }}
# Push the new tag to the remote repository
git push origin ${{ github.event.release.tag_name }}
# Create a new tag at the current commit
git tag ${{ github.event.release.tag_name }}
# Push the new tag to the remote repository
git push origin ${{ github.event.release.tag_name }}
else
echo "Version as expected. Skipping version update commit."
fi
- name: Get commit hash
id: get_commit_hash
Expand Down

0 comments on commit 12af831

Please sign in to comment.