This repository was archived by the owner on Jun 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (72 loc) · 2.24 KB
/
Copy pathdata-refresh.yml
File metadata and controls
86 lines (72 loc) · 2.24 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Data Refresh
on:
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
refresh:
name: Refresh Data
runs-on: ubuntu-latest
concurrency:
group: data-refresh
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Snapshot current data
run: |
mkdir -p "$RUNNER_TEMP/before-data"
cp -a data/. "$RUNNER_TEMP/before-data/"
- name: Refresh Getro data
run: node scripts/refresh-getro-ci.mjs
- name: Build site
run: npm run build
- name: Generate delta report
run: |
mkdir -p .github/.tmp
node scripts/report-data-delta.mjs \
--before-dir "$RUNNER_TEMP/before-data" \
--after-dir "data" \
--funds "accel,gc,blume" \
--out-dir ".github/.tmp"
- name: Publish report to run summary
run: cat .github/.tmp/data-delta.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload delta report artifacts
uses: actions/upload-artifact@v4
with:
name: data-refresh-delta
path: |
.github/.tmp/data-delta.json
.github/.tmp/data-delta.md
- name: Detect tracked data changes
id: changes
run: |
if git diff --quiet -- data/accel.json data/gc.json data/blume.json; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create or update pull request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.BOT_GH_TOKEN }}
commit-message: "chore(data): weekly refresh (getro)"
title: "chore(data): weekly refresh (getro)"
body-path: .github/.tmp/data-delta.md
branch: bot/data-refresh
delete-branch: false
add-paths: |
data/accel.json
data/gc.json
data/blume.json