File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
actions/lint-and-validate-specification Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 11name : " Lint and Validate OpenAPI v2 Spec"
22description : " Lint and validate an OpenAPI v2 (Swagger) specification using Spectral and Swagger CLI"
33inputs :
4- spec-file :
5- description : " Path to the OpenAPI v2 (Swagger) specification file "
4+ apim-env :
5+ description : " APIM environment for constructing the spec "
66 required : true
77
88runs :
@@ -11,17 +11,28 @@ runs:
1111 - name : Set up Node.js
1212 uses : actions/setup-node@v4
1313 with :
14- node-version : ' 20'
14+ node-version : " 20"
15+
16+ - name : Install dependencies
17+ shell : bash
18+ run : |
19+ sudo apt-get update
20+ sudo apt-get install -y make
1521
1622 - name : Install Spectral and Swagger CLI
1723 shell : bash
1824 run : |
1925 npm install -g @stoplight/spectral-cli swagger-cli
2026
27+ - name : Construct OpenAPI Spec
28+ shell : bash
29+ run : |
30+ make construct-spec APIM_ENV=${{ inputs.apim-env }}
31+
2132 - name : Lint OpenAPI Spec with Spectral
2233 shell : bash
23- run : spectral lint --ruleset .spectral.yaml ${{ inputs.spec-file }}
34+ run : spectral lint --ruleset .spectral.yaml build/specification/eligibility-signposting-api.yaml
2435
2536 - name : Validate OpenAPI Spec with Swagger CLI
2637 shell : bash
27- run : swagger-cli validate ${{ inputs.spec-file }}
38+ run : swagger-cli validate build/specification/eligibility-signposting-api.yaml
Original file line number Diff line number Diff line change @@ -118,4 +118,5 @@ jobs:
118118 - uses : actions/checkout@v4
119119 - uses : ./.github/actions/lint-and-validate-specification
120120 with :
121- spec-file : specification/eligibility-signposting-api.yaml
121+ spec-file : build/specification/eligibility-signposting-api.yaml
122+ apim-env : sandbox # or your desired environment
You can’t perform that action at this time.
0 commit comments