-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (41 loc) · 1.37 KB
/
Copy pathsync-database.yml
File metadata and controls
53 lines (41 loc) · 1.37 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Sync TigerTag database
on:
schedule:
# Every 6 hours. Adjust the cron if you want a different cadence.
- cron: '0 */6 * * *'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: sync-database
cancel-in-progress: false
env:
# Opt in to Node.js 24 for JavaScript actions ahead of the June 2026
# forced cutover (see github.blog/changelog/2025-09-19-deprecation-of-node-20).
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install --no-cache-dir requests
- name: Run incremental sync
run: python database/db_update.py
- name: Commit and push if changes
run: |
if [[ -z "$(git status --porcelain database/)" ]]; then
echo "No dataset changes — nothing to commit."
exit 0
fi
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add database/
changed=$(git diff --cached --name-only | xargs -n1 basename | paste -sd ', ' -)
git commit -m "Auto-sync database: ${changed}"
git push