This action uses the swagger-cli to validate a given swagger file(s).
Required The name of the file(s) to validate. Can be a single file path or a list of files.
See example for suggested command for finding all files ending in "openapi.yaml".
example.openapi.yaml is valid
example.openapi.yaml is invalid
uses: mbowman100/swagger-validator-action@v1
with:
files:
example.openapi.yaml
on: push
name: Validate API swagger documentation
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get OpenAPI files
run: |
FILES="$(find . -iname "*openapi.yaml")"
echo ::set-env name=FILE_LIST::$FILES
- name: swagger-validator
uses: mbowman100/swagger-validator-action@master
with:
files: ${{ env.FILE_LIST }}