From 234703072e0f75e2351c304f487fc8292de84089 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 25 Jul 2026 10:27:20 +0700 Subject: [PATCH] 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. --- data/.github/workflows/sync-champions.yml | 46 --------------------- data/.github/workflows/update-champions.yml | 4 -- 2 files changed, 50 deletions(-) delete mode 100644 data/.github/workflows/sync-champions.yml diff --git a/data/.github/workflows/sync-champions.yml b/data/.github/workflows/sync-champions.yml deleted file mode 100644 index 687839c..0000000 --- a/data/.github/workflows/sync-champions.yml +++ /dev/null @@ -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: [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 diff --git a/data/.github/workflows/update-champions.yml b/data/.github/workflows/update-champions.yml index 1f5cab9..50d1ed2 100644 --- a/data/.github/workflows/update-champions.yml +++ b/data/.github/workflows/update-champions.yml @@ -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