LLMProviders / .github /workflows /update-benchmarks.yml
CrispStrobe
ci: fix HF authentication in workflows by embedding token in remote URL
ff2d960
name: Update benchmark data
on:
schedule:
- cron: '0 4 * * 0' # weekly, Sunday at 04:00 UTC
workflow_dispatch: # allow manual trigger from GitHub Actions UI
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm install
- name: Fetch all benchmark data
run: node scripts/fetch-benchmarks.js
- name: Commit if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/benchmarks.json
git diff --staged --quiet && echo "No changes." || (
git commit -m "chore: update benchmark data [skip ci]" &&
git pull --rebase origin main &&
git push origin main
)
- name: Sync to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
if [ -z "$HF_TOKEN" ]; then
echo "HF_TOKEN is not set, skipping sync."
exit 0
fi
git remote add hf https://cstr:$HF_TOKEN@huggingface.co/spaces/cstr/LLMProviders || true
# Prepend metadata only for the HF version of README
cat .huggingface/space.yml README.md > HF_README.md
mv HF_README.md README.md
git commit -am "chore: sync to Hugging Face with metadata" || true
git push hf main --force