forked from urgent-challenge/urgent2024
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.62 KB
/
update-leaderboard.yml
File metadata and controls
60 lines (50 loc) · 1.62 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Update Leaderboard
on:
schedule:
- cron: '0 * * * *' # every hour
workflow_dispatch: {}
permissions:
contents: write # allow pushing changes back
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Clean old leaderboard artifacts
run: |
rm -rf codabench_results || true
mkdir -p codabench_results
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests pandas plotly
- name: Run leaderboard fetch
env:
CB_USERNAME: ${{ secrets.CB_USERNAME }}
CB_PASSWORD: ${{ secrets.CB_PASSWORD }}
CB_SECRET_KEY: ${{ secrets.CB_SECRET_KEY }}
CB_BASE: ${{ secrets.CB_BASE }}
CB_PK: ${{ secrets.CB_PK }}
CB_OUT: codabench_results
run: |
python get_leaderboard.py
- name: Build leaderboard HTML (new)
run: |
python build_leaderboard_html.py
- name: Commit and push if changed
run: |
set -e
if [ -n "$(git status --porcelain)" ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A codabench_results _includes/leaderboard_generated.html
git commit -m "Update leaderboard: $(date -u +%FT%TZ)"
git push
else
echo "No changes to commit."
fi