chore: setup openapi contract gate [AC-INIT]
PR Check (SDD Contract Gate) / contract-level-check (pull_request) Successful in 3s Details

This commit is contained in:
MerCry 2026-02-23 23:16:03 +08:00
parent 132f1ffecb
commit c035d4b7b4
1 changed files with 14 additions and 1 deletions

View File

@ -59,7 +59,20 @@ jobs:
set -eu set -eu
if command -v python3 >/dev/null 2>&1; then if command -v python3 >/dev/null 2>&1; then
python3 -c "import sys; print('python3:', sys.version.split()[0])" python3 -c "import sys; print('python3:', sys.version.split()[0])"
# Try to install pyyaml if missing
if ! python3 -c "import yaml" 2>/dev/null; then
echo "PyYAML missing, attempting to install..."
python3 -m pip install pyyaml --user >/dev/null 2>&1 || true
fi
# Check again and run if available
if python3 -c "import yaml" 2>/dev/null; then
find spec -name "*.yaml" -o -name "*.yml" | xargs -I {} python3 -c "import yaml; yaml.safe_load(open('{}'))" find spec -name "*.yaml" -o -name "*.yml" | xargs -I {} python3 -c "import yaml; yaml.safe_load(open('{}'))"
echo "YAML check passed."
else
echo "PyYAML still missing; skipping YAML parse check."
fi
else else
echo "python3 not available; skip YAML parse check" echo "python3 not available; skip YAML parse check"
fi fi