Skip to content

Commit b9b0d25

Browse files
committed
I hate pypi.
1 parent fbbdfc1 commit b9b0d25

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/pr-preview.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
env:
3333
VERSION: ${{ env.VERSION }}
3434
run: |
35-
if curl -s https://test.pypi.org/pypi/socketsecurity/$VERSION/json | grep -q '"version": "'$VERSION'"'; then
35+
if curl -s -f https://test.pypi.org/pypi/socketsecurity/$VERSION/json > /dev/null; then
3636
echo "Version ${VERSION} already exists on Test PyPI"
3737
echo "exists=true" >> $GITHUB_OUTPUT
3838
else
@@ -103,16 +103,16 @@ jobs:
103103
env:
104104
VERSION: ${{ env.VERSION }}
105105
run: |
106-
# Wait for package to be available (try up to 5 times with 60s delay)
107-
for i in {1..5}; do
108-
if curl -s https://test.pypi.org/pypi/socketsecurity/$VERSION/json | grep -q '"version": "'$VERSION'"'; then
106+
# Wait for package to be available (try up to 30 times with 20s delay - total 10 minutes)
107+
for i in {1..30}; do
108+
if curl -s -f https://test.pypi.org/pypi/socketsecurity/$VERSION/json > /dev/null; then
109109
echo "Package ${VERSION} is now available on Test PyPI"
110110
exit 0
111111
fi
112-
echo "Attempt $i: Package not yet available, waiting 60s..."
113-
sleep 60
112+
echo "Attempt $i: Package not yet available, waiting 20s... (${i}/30)"
113+
sleep 20
114114
done
115-
echo "Package ${VERSION} not available after 5 attempts"
115+
echo "Package ${VERSION} not available after 10 minutes"
116116
exit 1
117117
118118
- name: Login to Docker Hub

0 commit comments

Comments
 (0)