diff --git a/.github/workflows/release-mcp-server.yml b/.github/workflows/release-mcp-server.yml index 76f29c24..62ff8609 100644 --- a/.github/workflows/release-mcp-server.yml +++ b/.github/workflows/release-mcp-server.yml @@ -90,14 +90,18 @@ jobs: id: graphiti run: | # Query PyPI for the latest graphiti-core version with error handling - set -e - GRAPHITI_VERSION=$(curl -sf https://pypi.org/pypi/graphiti-core/json | python -c "import sys, json; data=json.load(sys.stdin); print(data['info']['version'])" 2>&1) + set -eo pipefail - if [ -z "$GRAPHITI_VERSION" ] || [ "$?" -ne 0 ]; then + if ! GRAPHITI_VERSION=$(curl -sf https://pypi.org/pypi/graphiti-core/json | python -c "import sys, json; data=json.load(sys.stdin); print(data['info']['version'])"); then echo "Error: Failed to fetch graphiti-core version from PyPI" exit 1 fi + if [ -z "$GRAPHITI_VERSION" ]; then + echo "Error: Empty version returned from PyPI" + exit 1 + fi + echo "graphiti_version=${GRAPHITI_VERSION}" >> $GITHUB_OUTPUT echo "Latest Graphiti Core version from PyPI: ${GRAPHITI_VERSION}"