mirror of
https://github.com/tiennm99/loldle.git
synced 2026-10-11 03:13:42 +00:00
ci: remove champions sync to archived downstream repo
The loldle repo is archived and read-only, so every push after a data update failed with a 403. Consumers read champions.json from this repo directly instead. Checkout no longer overrides the token: the PAT existed only so the data commit would trigger the sync workflow, and contents: write on the default GITHUB_TOKEN covers the push.
This commit is contained in:
1 parent
33d4379f6e
commit
234703072e
2 files changed
-50
No files matched your search
-46
@@ -1,46 +0,0 @@
|
||||
name: Sync champions to downstream repos
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [champions.json]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
# Fan out champions.json to downstream repos.
|
||||
# Each row: <repo> <dest-path> [post-copy command].
|
||||
# Add a new target by appending one line — no other edits required.
|
||||
- name: Sync
|
||||
env:
|
||||
GH_PAT: ${{ secrets.LOLDLE_PAT }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
sync_repo() {
|
||||
local repo=$1 dest=$2 post=${3:-}
|
||||
local dir=${repo##*/}
|
||||
git clone --depth 1 \
|
||||
"https://x-access-token:${GH_PAT}@github.com/${repo}.git" "$dir"
|
||||
cp champions.json "$dir/$dest"
|
||||
(
|
||||
cd "$dir"
|
||||
if [ -n "$post" ]; then eval "$post"; fi
|
||||
git add -A
|
||||
if git diff --cached --quiet; then
|
||||
echo "$repo already up to date"
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "chore(data): sync champions from loldle-data@${GITHUB_SHA::7}"
|
||||
git push
|
||||
)
|
||||
}
|
||||
|
||||
sync_repo tiennm99/loldle public/champions.json
|
||||
-4
@@ -13,12 +13,8 @@ jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# LOLDLE_PAT so the subsequent push triggers sync-champions.yml;
|
||||
# default GITHUB_TOKEN would silently skip downstream triggers.
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
token: ${{ secrets.LOLDLE_PAT }}
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
|
||||
Reference in new issue
Block a user