-
Notifications
You must be signed in to change notification settings - Fork 5
91 lines (80 loc) · 2.52 KB
/
sources.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: sources.json
on:
workflow_dispatch:
push:
paths:
- "sources.json"
pull_request_target:
types:
- opened
- synchronize
paths:
- "sources.json"
jobs:
validate-and-sort:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Pull
uses: actions/checkout@main
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.head_ref.repo.full_name || github.ref.repo.full_name }}
- name: Schema (walbo/validate-json)
continue-on-error: true
uses: walbo/validate-json@main
with:
files: sources.json
schema: sources.schema.json
schema-version: draft-07
allow-union-types: true
strict: false
allow-matching-properties: false
fail-on-missing-schema: true
# print-valid-files: false
- name: Schema (cardinalby/schema-validator-action)
continue-on-error: true
uses: cardinalby/schema-validator-action@master
with:
file: sources.json
schema: sources.schema.json
fixSchemas: true
- name: Schema (dsanders11/json-schema-validate-action)
continue-on-error: true
uses: dsanders11/json-schema-validate-action@main
with:
files: sources.json
schema: sources.schema.json
- name: Schema (ammarlakis/action-ajv)
continue-on-error: true
uses: ammarlakis/action-ajv@master
with:
data: sources.json
schema: sources.schema.json
allErrors: true
verbose: true
- name: Sort
continue-on-error: true
uses: yakubique/json-utils@main
id: sorted_sources
with:
space: 4 # indent
action: "sort"
type: "nested-json"
key: "name"
from_file: "true"
to_file: "true"
input: "sources.json"
- name: Move sorted
continue-on-error: true
run: |
cp "${{ steps.sorted_sources.outputs.result }}" sources.json
git add sources.json
- name: Push sorted
continue-on-error: true
uses: stefanzweifel/git-auto-commit-action@master
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[bot/no ci/json-utils] Sort sources.json\n\nskip-checks: true"