Update WisdomTree ETF data #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update WisdomTree ETF data | |
| on: | |
| # Weekly refresh (every Sunday at 00:00 UTC) plus manual runs. | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| 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: "" | |
| 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: "" | |
| type: string | |
| holdings_page_size: | |
| description: "Rows in each generated holdings JSON page" | |
| required: false | |
| default: "" | |
| type: string | |
| history_page_size: | |
| description: "Rows in each generated history JSON page" | |
| required: false | |
| default: "" | |
| 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: "" | |
| 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: "" | |
| type: string | |
| edgar_fallback: | |
| description: "Use SEC EDGAR Form N-PORT-P for full holdings (default on)" | |
| required: false | |
| default: "" | |
| 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 || '' }} | |
| REQUEST_SLEEP: ${{ inputs.request_sleep || '' }} | |
| AUM: ${{ inputs.aum || '' }} | |
| TER: ${{ inputs.ter || '' }} | |
| CONCURRENCY: ${{ inputs.concurrency || '' }} | |
| HOLDINGS_PAGE_SIZE: ${{ inputs.holdings_page_size || '' }} | |
| HISTORY_PAGE_SIZE: ${{ inputs.history_page_size || '' }} | |
| STORE_RAW_DOWNLOADS: ${{ inputs.store_raw_downloads || '' }} | |
| MAX_RETRIES: ${{ inputs.max_retries || '' }} | |
| TICKERS: ${{ inputs.tickers || '' }} | |
| DIVIDEND_YIELD: ${{ inputs.dividend_yield || '' }} | |
| HISTORY_RANGE: ${{ inputs.history_range || '' }} | |
| EDGAR_FALLBACK: ${{ inputs.edgar_fallback || '' }} | |
| 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@v7 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Run updater unit tests | |
| run: bun test scripts/update-data.test.ts | |
| - 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 |