Files

43 lines
1.0 KiB
YAML

name: Sync Rare Candy
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:
inputs:
force:
description: "Accept a big drop in card count (e.g. you really sold/removed cards)"
type: boolean
default: false
permissions:
contents: write
concurrency:
group: sync
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install --quiet pillow
- run: python scripts/sync_rarecandy.py
env:
FORCE_SYNC: ${{ inputs.force && '1' || '0' }}
- name: Commit if changed
run: |
if [ -z "$(git status --porcelain -- data images)" ]; then
echo "Nothing to commit"
exit 0
fi
git config user.name "card-sync-bot"
git config user.email "card-sync-bot@kburchtree.cloud"
git add data images
git commit -m "Sync Rare Candy collection"
git push