forked from spidernet-io/spiderpool
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.41 KB
/
lint-openapi.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: Auto Openapi Lint
on:
push:
branches:
- main
- release-*
paths:
- 'api/**/openapi.yaml'
pull_request:
branches:
- main
- release-*
paths:
- 'api/**/openapi.yaml'
workflow_dispatch:
inputs:
ref:
description: 'check for branch, sha, tag'
required: true
default: main
path:
description: 'openapi yaml path'
required: true
jobs:
link-check:
name: Openapi Lint
runs-on: ubuntu-latest
strategy:
matrix:
include:
- openapifilepath: 'api/v1/agent/openapi.yaml'
- openapifilepath: 'api/v1/controller/openapi.yaml'
steps:
- name: Checkout
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Checkout
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/checkout@v4
- name: Validate OpenAPI definition By PR
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: char0n/swagger-editor-validate@v1
with:
definition-file: ${{ matrix.openapifilepath }}
- name: Validate OpenAPI definition By Command
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: char0n/swagger-editor-validate@v1
with:
definition-file: ${{ github.event.inputs.path }}