Skip to content

Update WisdomTree ETF data #1

Update WisdomTree ETF data

Update WisdomTree ETF data #1

Workflow file for this run

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