Skip to content

Commit d1aa2c8

Browse files
authored
fix: use create-pull-request action for leaderboard updates (Dev-Card#642)
1 parent be2f1b9 commit d1aa2c8

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/leaderboard.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
permissions:
99
contents: write
10-
pull-requests: read
10+
pull-requests: write
1111
issues: read
1212

1313
jobs:
@@ -31,17 +31,13 @@ jobs:
3131
const script = require('./.github/scripts/generateLeaderboard.js');
3232
await script({ github, context });
3333
34-
- name: Commit leaderboard
35-
run: |
36-
git config user.name "github-actions[bot]"
37-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38-
39-
git add apps/web/public/leaderboard.json
40-
41-
if git diff --staged --quiet; then
42-
echo "No changes to commit"
43-
exit 0
44-
fi
45-
46-
git commit -m "chore: update leaderboard"
47-
git push
34+
- name: Create Pull Request
35+
uses: peter-evans/create-pull-request@v6
36+
with:
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
commit-message: "chore: update leaderboard"
39+
title: "chore: update leaderboard"
40+
body: "Automated update of contributor leaderboard data."
41+
branch: "automation/leaderboard-update"
42+
base: "main"
43+
delete-branch: true

0 commit comments

Comments
 (0)