-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.53 KB
/
validate.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
40
41
42
43
44
name: CI-validate
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get Repo
id: getrepo
uses: actions/checkout@v2
- name: Get OpenAPI files
id: getfiles
run: |
# Using github env (newline separated file list)
# find . -type f \( -iname ".*" ! -iname ".htaccess" \)
echo 'FILE_LIST<<EOF' >> $GITHUB_ENV
find . -type f -iname "*.swagger.json" ! -name '*BaseResourceS*' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
# files not checked:
find . -type f -name '*BaseResourceS*'
# Using step output (space separated file list)
FILES="$(find . -type f -iname "*.json")"
echo "::set-output name=file_list::$FILES"
- name: swagger-validator
#uses: mbowman100/swagger-validator-action@master
uses: mbowman100/swagger-validator-action@2.0
#'if: env.FILE_COUNT != '0' # Comment out if you want it to fail if no files found
with:
files: ${{ env.FILE_LIST }}
#files: ${{ steps.getfiles.outputs.file_list }} # For if you're using output