-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaction.yaml
More file actions
40 lines (34 loc) · 1.1 KB
/
action.yaml
File metadata and controls
40 lines (34 loc) · 1.1 KB
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
name: "Lint and Validate OpenAPI v2 Spec"
description: "Lint and validate an OpenAPI v2 (Swagger) specification using Spectral and Swagger CLI"
inputs:
apim-env:
description: "APIM environment for constructing the spec"
required: true
runs:
using: "composite"
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install system dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y make
- name: Install CLI tools locally
shell: bash
run: |
npm ci
- name: Construct OpenAPI Spec
shell: bash
run: |
make construct-spec APIM_ENV=${{ inputs.apim-env }}
- name: Lint OpenAPI Spec with Spectral
shell: bash
run: |
npx spectral lint --ruleset .spectral.yaml build/specification/${{ inputs.apim-env }}/eligibility-signposting-api.yaml
- name: Validate OpenAPI Spec with Swagger CLI
shell: bash
run: |
npx swagger-cli validate build/specification/${{ inputs.apim-env }}/eligibility-signposting-api.yaml