Skip to content

📝 Convert YAML to JSON #60

📝 Convert YAML to JSON

📝 Convert YAML to JSON #60

Workflow file for this run

name: 📝 Convert YAML to JSON
on:
push:
paths: ['QUERIES.yaml']
branches: [main]
workflow_dispatch:
workflow_run:
workflows: ["🌥 Sync queries from Public Templates"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- run: pip3 install pyyaml --user
- name: Convert YAML to JSON
run: cat QUERIES.yaml | python3 .github/scripts/yaml2json.py > QUERIES.json
- name: Commit and push changes
run: |
[[ "$(git status -s | wc -l)" == 0 ]] && exit 0
git config --local user.email "[email protected]"
git config --local user.name "ghost"
COMMIT_MSG="build: "
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] && COMMIT_MSG+="[force] "
COMMIT_MSG+="compile JSON [$(date "+%d/%m/%Y %T")] :robot:"
git commit -am "${COMMIT_MSG}"
git push origin "${GITHUB_REF_NAME}"