-
Notifications
You must be signed in to change notification settings - Fork 133
40 lines (32 loc) · 1.04 KB
/
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
name: Run Spectral on Pull Requests
on: pull_request
jobs:
build:
name: Run Spectral
runs-on: ubuntu-latest
steps:
# Check out the repository
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Add comment to PR
- name: Comment a pull_request
uses: mshick/add-pr-comment@v2
with:
message: "Thanks for your contribution. The .json file will be checked now with Spectral."
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Get the name of changed files
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
*.json
# Print the names of changed files
- name: Print changed files
run: |
echo "Changed files: ${{ steps.changed-files.outputs.modified_files }}"
# Run Spectral on changed files
- uses: stoplightio/[email protected]
with:
file_glob: ${{ steps.changed-files.outputs.modified_files }}