mirror of
https://github.com/tiennm99/loldle-data.git
synced 2026-05-21 04:24:22 +00:00
ci: fan out downstream sync on manual pushes too
Add push trigger (paths: champions.json) so direct edits to champions.json auto-sync to miti99bot and loldle without needing a workflow_dispatch. Scraper + commit steps skip on push events (the data is already committed); sync step runs when either changed=true from the scraper path OR the trigger is push. Default GITHUB_TOKEN commits don't retrigger workflows, so no self-loop.
This commit is contained in:
@@ -5,6 +5,12 @@ on:
|
||||
# Every Thursday at 06:00 UTC (day after Riot's Wednesday patch)
|
||||
- cron: "0 6 * * 4"
|
||||
workflow_dispatch:
|
||||
# Manual edits to champions.json fan out without needing to run the scraper.
|
||||
# Scraper-driven commits use the default GITHUB_TOKEN which (by policy) does
|
||||
# NOT retrigger workflows, so this path is safe from self-loops.
|
||||
push:
|
||||
branches: [main]
|
||||
paths: [champions.json]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -17,14 +23,17 @@ jobs:
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
if: github.event_name != 'push'
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Run scraper
|
||||
if: github.event_name != 'push'
|
||||
run: go run .
|
||||
|
||||
- name: Commit and push if changed
|
||||
if: github.event_name != 'push'
|
||||
id: commit
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
@@ -43,7 +52,7 @@ jobs:
|
||||
# Each row: <repo> <dest-path> [post-copy command].
|
||||
# Add a new target by appending one line — no other edits required.
|
||||
- name: Sync to downstream repos
|
||||
if: steps.commit.outputs.changed == 'true'
|
||||
if: github.event_name == 'push' || steps.commit.outputs.changed == 'true'
|
||||
env:
|
||||
GH_PAT: ${{ secrets.LOLDLE_PAT }}
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user