-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (33 loc) · 989 Bytes
/
validate.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
name: Validate YAML
on: push
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nwisbeta/validate-yaml-schema@v1.0.3
with:
yamlSchemasJson: |
{
"./nft_schema.json": "nfts/*"
}
- uses: actions/setup-python@v2
with:
python-version: "3.9"
cache: "pip"
- run: pip install -r requirements.txt
- uses: jannekem/run-python-script-action@v1
with:
script: |
import glob
import yaml
import json
from yaml.loader import SafeLoader
nfts = []
for nft in glob.glob("nfts/*.yaml"):
with open(nft) as f:
data = yaml.load(f, Loader=SafeLoader)
nfts.append(data)
with open("nfts.json", "w") as write_file:
json.dump(nfts, write_file, indent=4)
- run: cat nfts.json