Skip to content

Commit e6fe822

Browse files
committed
published version check update
1 parent abb9b18 commit e6fe822

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ jobs:
8585
echo "version=$VERSION" >> $GITHUB_OUTPUT
8686
8787
# Check if version already exists on PyPI
88-
if curl -s "https://pypi.org/pypi/pytest-api-cov/$VERSION/json" > /dev/null 2>&1; then
88+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/pytest-api-cov/$VERSION/json")
89+
if [ "$HTTP_CODE" = "200" ]; then
8990
echo "exists=true" >> $GITHUB_OUTPUT
9091
echo "Version $VERSION already published to PyPI"
9192
else
9293
echo "exists=false" >> $GITHUB_OUTPUT
93-
echo "Version $VERSION not found on PyPI"
94+
echo "Version $VERSION not found on PyPI (HTTP $HTTP_CODE)"
9495
fi
9596
9697
- name: Comment on publish workflow

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ jobs:
5454
fi
5555
5656
# Check if version exists on PyPI
57-
if curl -s "https://pypi.org/pypi/pytest-api-cov/$VERSION/json" > /dev/null 2>&1; then
57+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/pytest-api-cov/$VERSION/json")
58+
if [ "$HTTP_CODE" = "200" ]; then
5859
echo "pypi_exists=true" >> $GITHUB_OUTPUT
5960
echo "Version $VERSION already published to PyPI"
6061
else
6162
echo "pypi_exists=false" >> $GITHUB_OUTPUT
62-
echo "Version $VERSION not found on PyPI"
63+
echo "Version $VERSION not found on PyPI (HTTP $HTTP_CODE)"
6364
fi
6465
6566
- name: Create version tag

0 commit comments

Comments
 (0)