File size: 1,037 Bytes
e6b789f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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', [])))

          "