-
Notifications
You must be signed in to change notification settings - Fork 18
54 lines (48 loc) · 1.83 KB
/
api-linter.yml
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
name: "Run Spectral API Linter"
on:
pull_request:
branches:
- main
paths:
- "nerm/**"
jobs:
spectral_workflow:
name: Lint OpenAPI
runs-on: ubuntu-latest
steps:
# Checkout the pull request to run Spectral on
- name: Checkout PR branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
# Checkout custom spectral action to comment issues to the PR
- name: Checkout Spectral Action
uses: actions/checkout@v2
with:
repository: sailpoint-oss/github-spectral-action
path: spectral-comment-action
ref: main
# Install node and run npm install on spectral action to install required packages
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: |
ls -al
cd spectral-comment-action
npm ci
# Run get-changed-files step to get all files changed in the PR as a comma seperated list for the spectral linter action to process with our rulesets
- id: files
with:
format: "csv"
uses: masesgroup/retrieve-changed-files@v2
continue-on-error: true
# Run the spectral linter action and recieve a comment on the PR for any issues the linter found
- name: Spectral comment
uses: ./spectral-comment-action/
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file-glob: ${{ steps.files.outputs.all }}
spectral-root-ruleset: http://raw.githubusercontent.com/sailpoint-oss/api-linter/main/root-ruleset.yaml
spectral-path-ruleset: https://raw.githubusercontent.com/sailpoint-oss/api-linter/main/nerm-path-ruleset.yaml
spectral-schema-ruleset: https://raw.githubusercontent.com/sailpoint-oss/api-linter/main/nerm-schema-ruleset.yaml