Skip to content

Commit

Permalink
update lb action
Browse files Browse the repository at this point in the history
  • Loading branch information
hetulvp committed Apr 20, 2024
1 parent 63afd15 commit cf4c132
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 70 deletions.
70 changes: 0 additions & 70 deletions .github/workflows/update_leaderboard.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/update_leaderboard_after_merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Update leaderboard on PR Merge.

on:
push:
branches:
- development

jobs:
leaderboard_evaluation:
runs-on: ubuntu-latest
- uses: actions/checkout@v4
with:
# This may save additional git fetch roundtrip if
# merge-base is found within latest 20 commits
fetch-depth: 20
# Check changes in the source branch of the PR
- name: Check if there are any changes in submissions dir
uses: dorny/[email protected]
id: changes
with:
filters: |
src:
- 'session_2/challenge/submissions/**'
list-files: "shell"

- name: Print changed files
run: |
echo '${{ toJSON(steps.changes.outputs) }}'
# # Update leaderboard only if single file is changed in submission dir
# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }}
# name: Checkout code
# uses: actions/checkout@v4
# with:
# # Here we checkout the target branch of the PR
# ref: ${{ github.event.pull_request.base.ref }}
# token: ${{ secrets.GH_PAT }}

# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }}
# name: Install Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.10"

# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }}
# name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r session_2/challenge/requirements.txt

# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }}
# name: Run leaderboard update script
# id: leaderboard-update
# run: |
# cd session_2/challenge
# filename=$(basename "${{ steps.changes.outputs.src_files }}")
# filename_without_extension="${filename%.*}" # Remove extension
# python -m scripts.leaderboard --github_user="${{ github.event.pull_request.user.login }}" --prompt="$filename_without_extension"

# - if: ${{ (steps.changes.outputs.src == 'true') && (steps.changes.outputs.src_count == 1) }}
# name: Commit changes
# uses: EndBug/add-and-commit@v9
# with:
# default_author: github_actions

0 comments on commit cf4c132

Please sign in to comment.