Rework validate #240
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate OAS Files | |
| on: [push] | |
| jobs: | |
| discover-files: | |
| name: Discover OpenAPI Files | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Discover OpenAPI files | |
| id: set-matrix | |
| run: | | |
| files=$(find openapi/ -name "*.yml" -o -name "*.yaml" | jq -R -s -c 'split("\n")[:-1]') | |
| echo "matrix=${files}" >> $GITHUB_OUTPUT | |
| echo "Found files: ${files}" | |
| validate-openapi: | |
| needs: discover-files | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| openapi_file: ${{ fromJson(needs.discover-files.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Validate Schema for ${{ matrix.openapi_file }} | |
| uses: thiyagu06/openapi-validator-action@v1 | |
| with: | |
| filepath: ${{ matrix.openapi_file }} | |
| - name: Validate YAML for ${{ matrix.openapi_file }} | |
| uses: ibiqlik/action-yamllint@v3 | |
| with: | |
| file_or_dir: ${{ matrix.openapi_file }} | |
| config_file: .yamllint.yml |