ci: also push champions data to loldle repo

Mirrors the miti99bot push step — clones tiennm99/loldle, copies
champions.json into public/, commits and pushes. Gated on
LOLDLE_PUSH_TOKEN secret; step is a no-op when unset.
This commit is contained in:
2026-04-20 18:34:32 +07:00
parent d1dc6d8401
commit 2eb6b471d8
+20
View File
@@ -59,3 +59,23 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore(loldle): sync champions data from loldle-data@${GITHUB_SHA::7}"
git push
- name: Push to loldle
if: steps.commit.outputs.changed == 'true' && env.LOLDLE_PUSH_TOKEN != ''
env:
LOLDLE_PUSH_TOKEN: ${{ secrets.LOLDLE_PUSH_TOKEN }}
run: |
set -euo pipefail
git clone --depth 1 \
"https://x-access-token:${LOLDLE_PUSH_TOKEN}@github.com/tiennm99/loldle.git" loldle
cp champions.json loldle/public/champions.json
cd loldle
git add public/champions.json
if git diff --cached --quiet; then
echo "loldle already up to date"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore(data): sync champions data from loldle-data@${GITHUB_SHA::7}"
git push