-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (39 loc) · 1.33 KB
/
validate-json.yaml
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
on:
pull_request:
branches:
- main
name: Validate JSON
jobs:
validate:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Delete previous comment
uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: github-actions[bot]
issue_number: ${{ github.event.number }}
- uses: actions/checkout@v3
- name: Validate Category JSON
uses: dsanders11/json-schema-validate-action@v1.1.0
with:
schema: ".schema/category.json"
files: "*/config.json"
- name: Validate Manufacturer JSON
uses: dsanders11/json-schema-validate-action@v1.1.0
with:
schema: ".schema/manufacturer.json"
files: "*/*/config.json"
- name: Validate Controller JSON
uses: dsanders11/json-schema-validate-action@v1.1.0
with:
schema: ".schema/controller.json"
files: "*/*/*/config.json"
- name: Comment PR
if: failure()
uses: thollander/actions-comment-pull-request@v2.5.0
with:
message: |
Validation of the JSON files has failed, please check the [Github Action log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see why