-
Notifications
You must be signed in to change notification settings - Fork 16
39 lines (35 loc) · 970 Bytes
/
swagger.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Swagger Validate
on:
push:
paths:
- "documentation/api/**"
- ".github/workflows/swagger.yml"
branches:
- main
pull_request:
paths:
- "documentation/api/**"
- ".github/workflows/swagger.yml"
jobs:
list-docs:
name: Gather API definitions
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(ls documentation/api/*.yml | jq -Rsc 'split("\n")[:-1]')"
validate-swagger-docs:
needs: list-docs
name: ${{ format('Validating {0}', matrix.doc) }}
runs-on: ubuntu-latest
strategy:
matrix:
doc: ${{ fromJson(needs.list-docs.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- name: Validate API definition
uses: char0n/swagger-editor-validate@v1
with:
definition-file: ${{ matrix.doc }}