Skip to content

Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl… #35

Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl…

Merge branch 'nextjs' of https://github.com/DSGT-DLP/Deep-Learning-Pl… #35

name: OpenAPI Schema Validation
on:
push:
paths:
- "backend/openapi/**"
pull_request:
paths:
- "backend/openapi/**"
jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check file extensions
run: |
shopt -s globstar
for file in backend/openapi/**/*.yaml; do
if [[ ! "$file" =~ \.openapi\.yaml$ ]]; then
echo "Error: $file does not have the .openapi.yaml extension"
exit 1
fi
done
- name: Validate OpenAPI files
run: |
yarn add swagger-cli
for file in backend/openapi/*.yaml
do
echo "Validating $file"
yarn swagger-cli validate $file --no-color || exit 1
done