From 1a6b49998bcbe88cb78c3e6b89960ea23113f259 Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Thu, 30 Oct 2025 23:40:07 -0700 Subject: [PATCH] Fix error handling bug in PyPI version fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous error handling was broken due to set -e causing immediate exit, making the $? check unreachable. Changes: - Use set -eo pipefail for proper pipeline error handling - Check command success with if ! command; then pattern - Separate check for empty version string - Both checks now properly reachable and functional 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/release-mcp-server.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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}"