From da0aa5fed155523200662c2fe04795a1c37cfeff Mon Sep 17 00:00:00 2001 From: ramnnnn2006 Date: Tue, 23 Jun 2026 14:47:43 +0530 Subject: [PATCH] fix: use create-pull-request action for leaderboard updates --- .github/workflows/leaderboard.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/leaderboard.yml b/.github/workflows/leaderboard.yml index 3152a895..a1164d02 100644 --- a/.github/workflows/leaderboard.yml +++ b/.github/workflows/leaderboard.yml @@ -7,7 +7,7 @@ on: permissions: contents: write - pull-requests: read + pull-requests: write issues: read jobs: @@ -31,17 +31,13 @@ jobs: const script = require('./.github/scripts/generateLeaderboard.js'); await script({ github, context }); - - name: Commit leaderboard - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git add apps/web/public/leaderboard.json - - if git diff --staged --quiet; then - echo "No changes to commit" - exit 0 - fi - - git commit -m "chore: update leaderboard" - git push \ No newline at end of file + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: update leaderboard" + title: "chore: update leaderboard" + body: "Automated update of contributor leaderboard data." + branch: "automation/leaderboard-update" + base: "main" + delete-branch: true \ No newline at end of file