Compare commits

..

No commits in common. "151b4974037885709075c038f09c063d368fb2c7" and "8a0df0b67e18cfc2ed97117f468c2d1845671dc9" have entirely different histories.

1 changed files with 7 additions and 30 deletions

View File

@ -4,49 +4,26 @@ on:
pull_request:
branches: [ main ]
paths:
- '.gitea/workflows/**'
- 'scripts/**'
- 'spec/**'
- 'spec/**/openapi.provider.yaml'
- 'spec/**/openapi.deps.yaml'
- 'src/**'
jobs:
contract-level-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code (no GitHub dependency)
shell: sh
run: |
set -eu
# Expect Gitea-provided env vars in the runner
: "${GITEA_SERVER_URL:?GITEA_SERVER_URL is required}"
: "${GITEA_REPOSITORY:?GITEA_REPOSITORY is required}"
: "${GITEA_SHA:?GITEA_SHA is required}"
echo "GITEA_SERVER_URL=$GITEA_SERVER_URL"
echo "GITEA_REPOSITORY=$GITEA_REPOSITORY"
echo "GITEA_SHA=$GITEA_SHA"
git clone "$GITEA_SERVER_URL/$GITEA_REPOSITORY.git" .
git checkout "$GITEA_SHA"
- name: Checkout code
uses: actions/checkout@v3
- name: Run OpenAPI Contract Level Check
env:
# For PRs targeting main, enforce provider >= L2
REQUIRE_PROVIDER_L2: "1"
shell: sh
run: |
set -eu
chmod +x scripts/check-openapi-level.sh
./scripts/check-openapi-level.sh
- name: YAML Parse Check (Optional)
shell: sh
- name: YAML Lint (Optional)
run: |
set -eu
if command -v python3 >/dev/null 2>&1; then
python3 -c "import sys; print('python3:', sys.version.split()[0])"
find spec -name "*.yaml" -o -name "*.yml" | xargs -I {} python3 -c "import yaml; yaml.safe_load(open('{}'))"
else
echo "python3 not available; skip YAML parse check"
fi
# Simple check if yq or other linter is not available
find spec -name "*.yaml" -o -name "*.yml" | xargs -I {} python3 -c "import yaml, sys; yaml.safe_load(open('{}'))" || echo "YAML check skipped or failed"