Skip to content

Commit

Permalink
Release job version verification checks for an exact match
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhamon committed Jun 7, 2023
1 parent 0d3d43f commit 9df6fe4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ jobs:

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

0 comments on commit 9df6fe4

Please sign in to comment.