Skip to content

Commit ae2e1d7

Browse files
committed
leaderboard.yml: fix missing env vars
As we need to explicitly pass through the `secrets` contents. Also, improved git commit username / e-mail, as I noticed there's an official recommendation.
1 parent e816b53 commit ae2e1d7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/leaderboard.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,24 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: Update Leaderboard in README.md
18+
env:
19+
AOC_SESSION_COOKIE: ${{ secrets.AOC_SESSION_COOKIE }}
20+
AOC_LEADERBOARD_ID: ${{ secrets.AOC_LEADERBOARD_ID }}
1821
run: ./leaderboard-replace.sh
1922

2023
- name: Output README.md changes for debugging
2124
run: git diff README.md
2225

2326
- name: Commit and Push changes
27+
env:
28+
GIT_USER_NAME: "${{ github.actor }}"
29+
# see https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
30+
GIT_USER_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
2431
run: |
2532
set -e
2633
if ! git diff --no-patch --exit-code README.md; then
27-
git config --global user.name "${GITHUB_ACTOR}"
28-
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
34+
git config --global user.name "${GIT_USER_NAME}"
35+
git config --global user.email "${GIT_USER_EMAIL}"
2936
git commit -am "README.md: update leaderboard" \
3037
git push
3138
else

0 commit comments

Comments
 (0)