File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,33 @@ name: Validate
33on : [push]
44
55jobs :
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
You can’t perform that action at this time.
0 commit comments