11name : Generate DBs
22
33on :
4- # schedule:
5- # - cron: '0 12 * * *'
4+ schedule :
5+ - cron : ' 0 12 * * *'
66 push :
77 branches :
88 - main
@@ -15,62 +15,11 @@ jobs:
1515 runs-on : ubuntu-latest
1616
1717 steps :
18- - name : Checkout repository
19- uses : actions/checkout@v4
20-
21- - name : Set up Python
22- uses : actions/setup-python@v4
23- with :
24- python-version : ' 3.x'
25-
26- - name : Install Python dependencies
27- run : |
28- pip install tqdm
29-
30- - name : Generate MAD files from CSV
31- run : |
32- mkdir -p mad
33- python3 csv2mad.py ArcadeDatabase_CSV/ArcadeDatabase.csv
34-
35- - name : Configure Git
36- run : |
37- git config --global user.name "The CI/CD Bot"
38- git config --global user.email "[email protected] " 39-
40- - name : Create a new branch
41- run : |
42- BRANCH_NAME=update-mad-files-${{ github.run_id }}
43- git checkout -b $BRANCH_NAME
44- git add mad/
45- if git diff --cached --quiet; then
46- echo "No changes to commit"
47- echo "SKIP_PR=true" >> $GITHUB_ENV
48- else
49- git commit -m "Update generated MAD files"
50- git push origin $BRANCH_NAME
51- echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
52- fi
18+ - uses : actions/checkout@v4
5319
5420 - name : Generate DBs
55- if : env.SKIP_PR != 'true'
5621 run : |
22+ set -euo pipefail
23+ git config --global user.email "[email protected] " 24+ git config --global user.name "The CI/CD Bot"
5725 ./.github/generate_db.py
58-
59- - name : Commit generated DB files
60- if : env.SKIP_PR != 'true'
61- run : |
62- git add .
63- git commit -m "Add generated DB files" || echo "No new DB files to commit"
64- git push origin $BRANCH_NAME || true
65-
66- - name : Create Pull Request
67- if : env.SKIP_PR != 'true'
68- uses : peter-evans/create-pull-request@v6
69- with :
70- token : ${{ secrets.GITHUB_TOKEN }}
71- commit-message : " Update MAD and DB files"
72- title : " [Bot] Update MAD and DB files"
73- body : |
74- This pull request contains updated MAD files and the generated database files.
75- branch : ${{ env.BRANCH_NAME }}
76- base : main
0 commit comments