-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yaml
More file actions
39 lines (33 loc) · 1.15 KB
/
action.yaml
File metadata and controls
39 lines (33 loc) · 1.15 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
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 dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y make
- name: Install Spectral, Swagger CLI, and Redocly CLI
shell: bash
run: |
npm install -g @stoplight/spectral-cli swagger-cli @redocly/cli
- name: Construct OpenAPI Spec
shell: bash
run: |
make construct-spec APIM_ENV=${{ inputs.apim-env }}
- name: Lint OpenAPI Spec with Spectral
shell: bash
run: |
spectral lint --ruleset .spectral.yaml build/specification/${{ inputs.apim-env }}/eligibility-signposting-api.yaml
- name: Validate OpenAPI Spec with Swagger CLI
shell: bash
run: swagger-cli validate build/specification/${{ inputs.apim-env }}/eligibility-signposting-api.yaml