Skip to content

Commit 9df6fe4

Browse files
committed
Release job version verification checks for an exact match
The step in the release process that checks whether a release number has already been used, we are failing while trying to ship v2.2.2 because v2.2.2rc1 already exists. We need to check for an exact match rather than doing a simple grep match. Use `git rev-parse` to do an exact match check for whether a git tag already exists.
1 parent 0d3d43f commit 9df6fe4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/publish-to-pypi.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ jobs:
6565

6666
- name: Verify unique release number
6767
run: |
68-
if git tag -l | grep -q ${{ steps.bump.outputs.VERSION_TAG }}; then
69-
echo "Tag ${{ steps.bump.outputs.VERSION_TAG }} already exists, aborting"
68+
TAG_NAME=${{ steps.bump.outputs.VERSION_TAG }}
69+
if git rev-parse -q --verify "refs/tags/$TAG_NAME" >/dev/null; then
70+
echo "Tag $TAG_NAME already exists."
7071
exit 1
7172
fi
7273

0 commit comments

Comments
 (0)