Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Validate PR Documentation

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'openapi.json'

jobs:
validate-openapi:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Start Swagger Validator
run: |
# Pull the Swagger validator image
docker pull swaggerapi/swagger-validator-v2
# Start the validator container
docker run --detach --name swagger-validator --publish 8080:8080 swaggerapi/swagger-validator-v2
# Wait for the validator to be ready
timeout 30 bash -c 'until curl -f http://localhost:8080/health; do sleep 1; done'

- name: Validate OpenAPI JSON
run: |
echo "Validating openapi.json..."
curl --fail --request POST http://localhost:8080/validator/debug \
--header "Content-Type: application/json" \
--data-binary @openapi.json
echo "✅ openapi.json validation passed"

- name: Cleanup
if: always()
run: |
docker stop swagger-validator || true
docker rm swagger-validator || true