-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.14 KB
/
Copy pathrefresh-data.yml
File metadata and controls
40 lines (33 loc) · 1.14 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
name: Refresh data snapshots
# Re-fetches Pokémon base stats and the released-shiny list into data/ so the
# site does not depend on PoGoAPI being up at page load. Also reports curated
# CP values that have drifted from current base stats — check the run log.
on:
schedule:
- cron: '17 6 * * 1' # Mondays, 06:17 UTC
workflow_dispatch:
permissions:
contents: write
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Fetch and trim snapshots
run: npm run refresh-data
- name: Run tests against the refreshed data
run: node --test
- name: Commit if anything changed
run: |
if [[ -z "$(git status --porcelain data/)" ]]; then
echo "Snapshots already current — 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 data/
git commit -m "Refresh Pokémon data snapshots"
git push