Skip to content

Commit 0d95fbb

Browse files
committed
Fix PR preview worklfow to use updated version check
Signed-off-by: lelia <lelia@socket.dev>
1 parent fe75425 commit 0d95fbb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/pr-preview.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ jobs:
3737
VERSION=$(hatch version | cut -d+ -f1)
3838
echo "VERSION=$VERSION" >> $GITHUB_ENV
3939
40+
- name: Check if version already exists on Test PyPI
41+
id: version_check
42+
env:
43+
VERSION: ${{ env.VERSION }}
44+
run: |
45+
if curl -s -f https://test.pypi.org/pypi/socketsecurity/${VERSION}/json > /dev/null; then
46+
echo "exists=true" >> $GITHUB_OUTPUT
47+
else
48+
echo "exists=false" >> $GITHUB_OUTPUT
49+
fi
50+
4051
- name: Build package
4152
if: steps.version_check.outputs.exists != 'true'
4253
run: |
@@ -146,4 +157,4 @@ jobs:
146157
build-args: |
147158
CLI_VERSION=${{ env.VERSION }}
148159
PIP_INDEX_URL=https://test.pypi.org/simple
149-
PIP_EXTRA_INDEX_URL=https://pypi.org/simple
160+
PIP_EXTRA_INDEX_URL=https://pypi.org/simple

0 commit comments

Comments
 (0)