Files
hitster.gameset_database/.gitea/workflows/update.yaml
T
Michel b912f1bbc9
automatically check for updates / Check_for_update (push) Successful in 18s
Update .gitea/workflows/update.yaml
2025-05-16 21:59:24 +00:00

32 lines
1017 B
YAML

name: automatically check for updates
on:
push:
schedule:
- cron: "0 */12 * * *"
jobs:
Check_for_update:
runs-on: ubuntu-latest
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")
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