mirror of
https://github.com/tiennm99/loldle-data.git
synced 2026-05-18 09:25:59 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user