chore: add backward compatibility in CI

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-11-03 12:06:52 +01:00
parent 44e36ce48d
commit 0671189e34
No known key found for this signature in database

View file

@ -111,7 +111,17 @@ jobs:
exit 1 exit 1
fi fi
# Check base branch
# Handles old YAML specs
# TODO: remove this once the JSON specs are merged
if [ -f "docs/static/stable-llama-stack-spec.yaml" ]; then
echo "✓ Found legacy YAML format stable API spec in current branch"
BASE_SPEC="docs/static/stable-llama-stack-spec.yaml"
elif [ -f "docs/static/llama-stack-spec.yaml" ]; then
echo "✓ Found legacy YAML format monolithic API spec in current branch"
BASE_SPEC="docs/static/llama-stack-spec.yaml"
else
echo "No legacy YAML format API specs found in current branch, trying JSON specs"
if [ -f "base/docs/static/stable-llama-stack-spec.json" ]; then if [ -f "base/docs/static/stable-llama-stack-spec.json" ]; then
echo "✓ Found stable API spec in base branch" echo "✓ Found stable API spec in base branch"
BASE_SPEC="base/docs/static/stable-llama-stack-spec.json" BASE_SPEC="base/docs/static/stable-llama-stack-spec.json"
@ -122,6 +132,7 @@ jobs:
echo "❌ No API specs found in base branch" echo "❌ No API specs found in base branch"
exit 1 exit 1
fi fi
fi
# Export for next step # Export for next step
echo "BASE_SPEC=${BASE_SPEC}" >> $GITHUB_ENV echo "BASE_SPEC=${BASE_SPEC}" >> $GITHUB_ENV