Update pixereum.yaml #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |