Skip to content

Commit 175e962

Browse files
committed
added a step to wait for new package avail before docker build
1 parent 12976ab commit 175e962

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/pr-preview.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
verbose: true
6363

6464
- name: Comment on PR
65+
if: steps.version_check.outputs.exists != 'true'
6566
uses: actions/github-script@v7
6667
env:
6768
VERSION: ${{ env.VERSION }}
@@ -95,7 +96,21 @@ jobs:
9596
body: comment
9697
});
9798
98-
99+
- name: Verify package is available
100+
if: steps.version_check.outputs.exists != 'true'
101+
id: verify_package
102+
run: |
103+
# Wait for package to be available (try up to 5 times with 30s delay)
104+
for i in {1..5}; do
105+
if pip download --no-deps --dry-run --index-url https://test.pypi.org/simple/ "socketsecurity==${VERSION}" 2>/dev/null; then
106+
echo "Package ${VERSION} is now available on Test PyPI"
107+
exit 0
108+
fi
109+
echo "Attempt $i: Package not yet available, waiting 30s..."
110+
sleep 30
111+
done
112+
echo "Package ${VERSION} not available after 5 attempts"
113+
exit 1
99114
100115
- name: Login to Docker Hub
101116
uses: docker/login-action@v3

0 commit comments

Comments
 (0)