-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 1.38 KB
/
yaml2json.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
name: YAML2JSON
run-name: "Converting the original YAML files to JSON for the Datahub (created by ${{ github.actor }})"
on: [push]
jobs:
convert-yaml-to-json:
runs-on: ubuntu-latest
steps:
- run: echo "Automatically triggered by a ${{ github.event_name }} event."
- run: echo "branch = ${{ github.ref }}; repository = ${{ github.repository }}"
- run: echo "workspace = ${{ github.workspace }}"
- name: Check out repository code (necessary - otherwise the workspace is empty)
uses: actions/checkout@v4
- name: List files in the repository
run: |
ls ${{ github.workspace }}/*
- run: rm -rv ${{ github.workspace }}/forKinsukAndSjors/*
- name: running python script
run: |
pip install tqdm
python ${{ github.workspace }}/scripts/process_yaml2json.py
- run: git diff-index HEAD
- name: pushing generated files back to repo
run: |
if git diff --exit-code; then
echo "NOTHING TO COMMIT!!!"
else
git config user.email "[email protected]"
git config user.name "valevo"
git add .
git commit -m "automated commit by GitHub Action defined in scripts/yaml_to_json.yml"
git push
fi
# if: ${{ git diff-index HEAD }}
- run: echo "🍏 This job's status is ${{ job.status }}."