cs2-dataset / scripts /refresh-30d-sample.workflow.yml
aidancoit9203's picture
Initial verified 30-day rolling schema preview (CSV + Apache Parquet)
e6b789f
Raw History Blame Contribute Delete
1.04 kB
name: Refresh Rolling 30-Day CS2 Sample
on:
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: write
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Verify CITO_API_KEY secret
env:
CITO_API_KEY: ${{ secrets.CITO_API_KEY }}
run: |
if [ -z "$CITO_API_KEY" ]; then
echo "CITO_API_KEY secret not set; skipping automated pull."
exit 0
fi
pip install requests pandas pyarrow
python -c "
import os, requests, pandas as pd
key = os.environ['CITO_API_KEY']
r = requests.get('https://api.citoapi.com/api/v1/cs2/matches?status=completed&limit=100', headers={'x-api-key': key}, timeout=30)
r.raise_for_status()
print('Fetched latest completed CS2 matches:', len(r.json().get('data', [])))
"