mirror of
https://github.com/tiennm99/loldle.git
synced 2026-10-11 03:13:42 +00:00
feat: add weekly workflow to auto-update champions data
This commit is contained in:
1 parent
1778ca9db9
commit
c55cf36517
1 file changed
+31
+31
@@ -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
|
||||
Reference in new issue
Block a user