Update Leaderboard Data #2
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 Leaderboard Data | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' # Weekly Monday 06:00 UTC | |
| workflow_dispatch: | |
| inputs: | |
| source: | |
| description: 'External source to sync (leave empty for all)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install deps | |
| run: pip install jsonschema | |
| - name: Sync external leaderboards | |
| id: sync | |
| run: | | |
| SOURCE_ARG="" | |
| if [ -n "${{ inputs.source }}" ]; then | |
| SOURCE_ARG="--source ${{ inputs.source }}" | |
| fi | |
| python leaderboard/scripts/sync_external.py --apply $SOURCE_ARG | |
| - name: Fetch coverage and citations | |
| id: stats | |
| continue-on-error: true | |
| env: | |
| SEMANTIC_SCHOLAR_API_KEY: ${{ secrets.SEMANTIC_SCHOLAR_API_KEY }} | |
| run: | | |
| python leaderboard/scripts/update_coverage.py --fetch | |
| python leaderboard/scripts/update_citations.py --fetch | |
| - name: Validate results | |
| run: python leaderboard/scripts/validate.py | |
| - name: Create PR if changed | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| commit-message: 'data: update leaderboard data' | |
| title: 'data: update leaderboard data' | |
| body: | | |
| Automated weekly leaderboard data update. | |
| ### External leaderboards | |
| ${{ steps.sync.outputs.sync_summary || '- No changes' }} | |
| ### Citations | |
| ${{ steps.stats.outputs.citations_summary || '- Skipped or unchanged' }} | |
| ### Coverage | |
| ${{ steps.stats.outputs.coverage_summary || '- Skipped or unchanged' }} | |
| Validation passed. Review the diff for new/updated entries. | |
| branch: update-leaderboard-data | |
| delete-branch: true | |
| labels: data |