publish-to-pypi shoudn't delete any tag, not safe [ci skip]
@@ -61,11 +61,15 @@ jobs:
password: ${{ secrets.TESTPYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- - name: Delete tag if doesn't match with version
- if: contains(env.TAG_MISMATCH, 'true')
- run: |
- git config --local user.email "action@github.com"
- git config --local user.name "GitHub Action"
- REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
- remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${REPOSITORY}.git"
- git push "${remote_repo}" :refs/tags/$TAG
+ # Not a good idea: if a non-conforming tag is push, e.g. random_tag, it
+ # first gets deleted by cleanup-tags.yml, and then publish-to-pypi.yml gets
+ # tricked and deletes the most recent tag! Ouch!
+
+ # - name: Delete tag if doesn't match with version
+ # if: contains(env.TAG_MISMATCH, 'true')
+ # run: |
+ # git config --local user.email "action@github.com"
+ # git config --local user.name "GitHub Action"
+ # REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
+ # remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${REPOSITORY}.git"
+ # git push "${remote_repo}" :refs/tags/$TAG
