cyrusyc commited on
Commit
b42eccd
1 Parent(s): 3ca27ab

try to gracefully bail

Browse files
Files changed (1) hide show
  1. .github/workflows/release.yaml +4 -4
.github/workflows/release.yaml CHANGED
@@ -35,12 +35,12 @@ jobs:
35
  VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
36
  echo "VERSION=$VERSION" >> $GITHUB_ENV
37
 
38
- # Step 5: Check if tag already exists
39
- - name: Check if tag exists
40
  id: check_tag
41
  run: |
42
- if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
43
- echo "Tag v${{ env.VERSION }} already exists."
44
  exit 0
45
  fi
46
 
 
35
  VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
36
  echo "VERSION=$VERSION" >> $GITHUB_ENV
37
 
38
+ # Step 5: Check if tag exists on remote
39
+ - name: Check if tag exists on remote
40
  id: check_tag
41
  run: |
42
+ if git ls-remote --tags origin | grep "refs/tags/v${{ env.VERSION }}"; then
43
+ echo "Tag v${{ env.VERSION }} already exists on remote."
44
  exit 0
45
  fi
46