Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…erboard into test-pr-2
  • Loading branch information
HarshTrivedi committed Nov 29, 2024
2 parents 832b558 + 3d224b1 commit 8025108
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/leaderboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,8 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -f experiments/outputs/_leaderboard.json
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m "add leaderboard entry"
git push origin ${{ steps.get-branch.outputs.branch }}
fi
git commit -m "add leaderboard entry" || true
git push origin ${{ steps.get-branch.outputs.branch }} || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 5 additions & 0 deletions scripts/add_to_leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def validate_diff(experiment_prefixes: list[str]) -> None:
text=True,
)
added_file_paths = output.stdout.strip().splitlines()
added_file_paths = [
file_path
for file_path in added_file_paths
if file_path == os.path.join("experiments", "outputs", "_leaderboard.json")
]
output = subprocess.run(
["git", "diff", "origin/main", "--diff-filter=MD", "--name-only"],
capture_output=True,
Expand Down

0 comments on commit 8025108

Please sign in to comment.