Skip to content

Commit 6c7dab9

Browse files
committed
Fully match version
1 parent 71df2e3 commit 6c7dab9

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

.github/workflows/merge.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ jobs:
4040
PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
4141
PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
4242
43-
# Use jq to check for the version in the releases object
44-
EXISTING_VERSIONS=$(curl -s "https://pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
45-
4643
echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
4744
48-
if [[ "$EXISTING_VERSIONS" =~ "$PACKAGE_VERSION" ]]; then
45+
if curl -s "https://pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^$PACKAGE_VERSION$"; then
4946
echo "Package version already exists. Skipping upload."
5047
echo "should_publish=false" >> $GITHUB_OUTPUT
5148
else

.github/workflows/verify.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,9 @@ jobs:
261261
. venv/bin/activate
262262
PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
263263
PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
264-
265-
# Use jq to check for the version in the releases object
266-
EXISTING_VERSIONS=$(curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
267-
268264
echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
269265
270-
if [[ "$EXISTING_VERSIONS" =~ "$PACKAGE_VERSION" ]]; then
266+
if curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^$PACKAGE_VERSION$"; then
271267
echo "Package version already exists. Skipping upload."
272268
echo "should_publish=false" >> $GITHUB_OUTPUT
273269
else

0 commit comments

Comments
 (0)