Skip to content

Commit bd6f2c4

Browse files
committed
Fully match version
1 parent c01e9ec commit bd6f2c4

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,9 @@ jobs:
298298
PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
299299
PACKAGE_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
300300
301-
# Use jq to check for the version in the releases object
302-
EXISTING_VERSIONS=$(curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq '.releases | keys[]')
303-
304301
echo "Checking for package: $PACKAGE_NAME==$PACKAGE_VERSION"
305302
306-
if [[ "$EXISTING_VERSIONS" =~ "$PACKAGE_VERSION" ]]; then
303+
if curl -s "https://test.pypi.org/pypi/$PACKAGE_NAME/json" | jq -r '.releases | keys[]' | grep -q "^$PACKAGE_VERSION$"; then
307304
echo "Package version already exists. Skipping upload."
308305
echo "should_publish=false" >> $GITHUB_OUTPUT
309306
else

0 commit comments

Comments
 (0)