Add semantic version validation to MCP server release

Validate tag follows X.Y.Z format before processing.
Rejects malformed tags like mcp-v1.0 or mcp-v1.0.0.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Daniel Chalef 2025-10-27 11:56:57 -07:00
parent 3e4764033f
commit 3b2fecb03c

View file

@ -29,6 +29,12 @@ jobs:
id: version
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/mcp-v}
if ! [[ $TAG_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag must follow semantic versioning: mcp-vX.Y.Z"
exit 1
fi
PROJECT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('mcp_server/pyproject.toml', 'rb'))['project']['version'])")
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then