Update .gitea/workflows/update.yaml
This commit is contained in:
1 parent
f6ab7445dc
commit
72123e0de2
1 file changed
+9
-6
@@ -11,21 +11,24 @@ jobs:
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: install jq
|
||||
run: |
|
||||
apt update
|
||||
apt install jq -y
|
||||
|
||||
- name: update hitster gameset database
|
||||
run: |
|
||||
wget https://hitster.jumboplay.com/hitster-assets/gameset_database.json -O gameset_database.json
|
||||
rm -f gameset_database.json.*
|
||||
|
||||
- name: git commit
|
||||
run: |
|
||||
git config user.name "${{ secrets.GIT_USERNAME }}"
|
||||
git config user.email "${{ secrets.GIT_USEREMAIL }}"
|
||||
updated_on=$(cat "./gameset_database.json" | jq -r ".updated_on")
|
||||
|
||||
# Python leest de JSON uit zonder apt-dependencies
|
||||
updated_on=$(python3 -c "import json; print(json.load(open('./gameset_database.json'))['updated_on'])")
|
||||
mtime=$(date -d "@${updated_on}")
|
||||
|
||||
git add .
|
||||
export GIT_COMMITTER_DATE=$mtime
|
||||
export GIT_AUTHOR_DATE=$mtime
|
||||
if [ -n "$(git diff --staged)" ]; then git commit --date "$mtime" -m "Updated on: $updated_on" && git push; fi
|
||||
if [ -n "$(git diff --staged)" ]; then
|
||||
git commit --date "$mtime" -m "Updated on: $updated_on" && git push
|
||||
fi
|
||||
Reference in new issue
Block a user