Skip to content

Commit c9465e0

Browse files
author
Genevieve Nuebel
committed
Add all openapi files to OAS Validation
1 parent 780ac31 commit c9465e0

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/validate.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,33 @@ name: Validate
33
on: [push]
44

55
jobs:
6-
Test:
6+
discover-files:
77
runs-on: ubuntu-latest
8+
outputs:
9+
matrix: ${{ steps.set-matrix.outputs.matrix }}
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Discover OpenAPI files
13+
id: set-matrix
14+
run: |
15+
files=$(find openapi/ -name "*.yml" -o -name "*.yaml" | jq -R -s -c 'split("\n")[:-1]')
16+
echo "matrix=${files}" >> $GITHUB_OUTPUT
17+
echo "Found files: ${files}"
18+
19+
validate:
20+
needs: discover-files
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
openapi_file: ${{ fromJson(needs.discover-files.outputs.matrix) }}
825
steps:
926
- uses: actions/checkout@v3
1027
- name: Validate OpenAPI Schema
1128
uses: thiyagu06/openapi-validator-action@v1
1229
with:
13-
filepath: 'openapi/mx_platform_api.yml'
30+
filepath: ${{ matrix.openapi_file }}
1431
- name: Validate OpenAPI YAML
1532
uses: ibiqlik/action-yamllint@v3
1633
with:
17-
file_or_dir: openapi/mx_platform_api.yml
34+
file_or_dir: ${{ matrix.openapi_file }}
1835
config_file: .yamllint.yml

0 commit comments

Comments
 (0)