From c55cf365172c45deb5e234855598aea5146a411d Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 5 Apr 2026 12:16:48 +0700 Subject: [PATCH] feat: add weekly workflow to auto-update champions data --- data/.github/workflows/update-champions.yml | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 data/.github/workflows/update-champions.yml diff --git a/data/.github/workflows/update-champions.yml b/data/.github/workflows/update-champions.yml new file mode 100644 index 0000000..218c135 --- /dev/null +++ b/data/.github/workflows/update-champions.yml @@ -0,0 +1,31 @@ +name: Update champions data + +on: + schedule: + # Every Thursday at 06:00 UTC (day after Riot's Wednesday patch) + - cron: "0 6 * * 4" + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Run scraper + run: go run . + + - name: Commit and push if changed + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add champions.json + git diff --cached --quiet && echo "No changes to commit" && exit 0 + git commit -m "chore: update champions data to latest patch" + git push