-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (52 loc) · 1.61 KB
/
openapi-validation.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
name: OpenAPI Validation
on:
pull_request:
branches:
- develop
- master
jobs:
validate-openapi:
runs-on: ubuntu-latest
steps:
- id: check-pr-author
name: Check PR author
env:
BOT_NAME: fattureincloud-bot
run: |
echo "Checking if this PR must be validated..."
echo "This PR is opened by ${{ github.event.pull_request.user.login }} ."
if [ '${{ github.event.pull_request.user.login }}' == '${{ env.BOT_NAME }}' ];
then
echo "WORKFLOW MUST BE SKIPPED!"
echo "status=stop" >> $GITHUB_ENV
else
echo "EXECUTING..."
echo "status=execute" >> $GITHUB_ENV;
fi
- id: checkout
if: ${{ env.status == 'execute' }}
name: Checkout repo
uses: actions/checkout@v4
- id: setup-node
if: ${{ env.status == 'execute' }}
name: Setup Node.js
uses: actions/setup-node@v4
- id: setup-java
if: ${{ env.status == 'execute' }}
name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- id: setup-libraries
if: ${{ env.status == 'execute' }}
name: Install libraries
run: |
npm install -g yarn
yarn global add @apidevtools/swagger-cli @openapitools/openapi-generator-cli
- id: validate-spec
if: ${{ env.status == 'execute' }}
name: Validate specification
run: |
swagger-cli validate openapi.yaml
openapi-generator-cli validate -i ./openapi.yaml