-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (189 loc) · 6.5 KB
/
Copy pathupdate-data.yml
File metadata and controls
200 lines (189 loc) · 6.5 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Update WisdomTree ETF data
on:
workflow_dispatch:
inputs:
max_fetches:
description: "Batch size; continue after the saved ticker cursor; empty or 0 means a full pass over every catalog fund"
required: false
default: ""
type: string
request_sleep:
description: "Seconds between outgoing request starts; keep requests polite to WisdomTree, SEC and Yahoo"
required: false
default: "2"
type: string
aum:
description: "AUM min:max; bounds may be amounts or K/M/B/T suffixes, or nano/micro/small/mid/large"
required: false
default: ":"
type: string
ter:
description: "Net expense ratio range in percent: min:max"
required: false
default: ":"
type: string
concurrency:
description: "Parallel fund workers (keep low)"
required: false
default: "2"
type: string
holdings_page_size:
description: "Rows in each generated holdings JSON page"
required: false
default: "250"
type: string
history_page_size:
description: "Rows in each generated history JSON page"
required: false
default: "1000"
type: string
store_raw_downloads:
description: "Store the official rendered catalog under api/wisdomtree/raw"
required: false
default: ""
type: string
max_retries:
description: "Retries after the initial request"
required: false
default: "2"
type: string
tickers:
description: "Only update these tickers, separated by spaces or commas"
required: false
default: ""
type: string
dividend_yield:
description: "Catalog trailing-yield percentage range; colon required"
required: false
default: ":"
type: string
history_range:
description: "Yahoo chart range for history rows (max, 10y, 5y, ...)"
required: false
default: "max"
type: string
edgar_fallback:
description: "Use SEC EDGAR Form N-PORT-P for full holdings (default on)"
required: false
default: "1"
type: string
skip_yahoo:
description: "Keep previous history and distributions while refreshing catalog/holdings"
required: false
default: ""
type: string
skip_wisdomtree:
description: "Keep the previously published official catalog"
required: false
default: ""
type: string
performance_ytd:
description: "Annualized YTD adjusted-close return range: min:max"
required: false
default: ""
type: string
performance_1y:
description: "Annualized 1Y adjusted-close return range"
required: false
default: ""
type: string
performance_3y:
description: "Annualized 3Y adjusted-close return range"
required: false
default: ""
type: string
performance_5y:
description: "Annualized 5Y adjusted-close return range"
required: false
default: ""
type: string
performance_10y:
description: "Annualized 10Y adjusted-close return range"
required: false
default: ""
type: string
total_return_ytd:
description: "Cumulative YTD adjusted-close return range"
required: false
default: ""
type: string
total_return_1y:
description: "Cumulative 1Y adjusted-close return range"
required: false
default: ""
type: string
total_return_3y:
description: "Cumulative 3Y adjusted-close return range"
required: false
default: ""
type: string
total_return_5y:
description: "Cumulative 5Y adjusted-close return range"
required: false
default: ""
type: string
total_return_10y:
description: "Cumulative 10Y adjusted-close return range"
required: false
default: ""
type: string
permissions:
contents: write
concurrency:
group: update-wisdomtree-data
cancel-in-progress: false
jobs:
update-data:
runs-on: ubuntu-latest
env:
MAX_FETCHES: ${{ inputs.max_fetches || '0' }}
REQUEST_SLEEP: ${{ inputs.request_sleep || '2' }}
AUM: ${{ inputs.aum || ':' }}
TER: ${{ inputs.ter || ':' }}
CONCURRENCY: ${{ inputs.concurrency || '2' }}
HOLDINGS_PAGE_SIZE: ${{ inputs.holdings_page_size || '250' }}
HISTORY_PAGE_SIZE: ${{ inputs.history_page_size || '1000' }}
STORE_RAW_DOWNLOADS: ${{ inputs.store_raw_downloads || '' }}
MAX_RETRIES: ${{ inputs.max_retries || '2' }}
TICKERS: ${{ inputs.tickers || '' }}
DIVIDEND_YIELD: ${{ inputs.dividend_yield || ':' }}
HISTORY_RANGE: ${{ inputs.history_range || 'max' }}
EDGAR_FALLBACK: ${{ inputs.edgar_fallback || '1' }}
SKIP_YAHOO: ${{ inputs.skip_yahoo || '' }}
SKIP_WISDOMTREE: ${{ inputs.skip_wisdomtree || '' }}
PERFORMANCE_YTD: ${{ inputs.performance_ytd || '' }}
PERFORMANCE_1Y: ${{ inputs.performance_1y || '' }}
PERFORMANCE_3Y: ${{ inputs.performance_3y || '' }}
PERFORMANCE_5Y: ${{ inputs.performance_5y || '' }}
PERFORMANCE_10Y: ${{ inputs.performance_10y || '' }}
TOTAL_RETURN_YTD: ${{ inputs.total_return_ytd || '' }}
TOTAL_RETURN_1Y: ${{ inputs.total_return_1y || '' }}
TOTAL_RETURN_3Y: ${{ inputs.total_return_3y || '' }}
TOTAL_RETURN_5Y: ${{ inputs.total_return_5y || '' }}
TOTAL_RETURN_10Y: ${{ inputs.total_return_10y || '' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Validate inline browser script
run: bun ./scripts/check-index.ts
- name: Run updater unit tests
run: bun test scripts/update-data.test.ts
- name: Type-check updater and tests
run: bunx tsc --noEmit
- name: Generate api/wisdomtree static data
run: bun ./scripts/update-data.ts
- name: Commit updated data
run: |
if git diff --quiet -- api/wisdomtree; then
echo "api/wisdomtree is already up to date"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add api/wisdomtree
git commit -m "Update WisdomTree ETF data"
git push