diff --git a/.github/workflows/sync-loldle-data.yml b/.github/workflows/sync-loldle-data.yml deleted file mode 100644 index c3ca9f2..0000000 --- a/.github/workflows/sync-loldle-data.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Sync loldle data - -on: - repository_dispatch: - types: [loldle-data-updated] - workflow_dispatch: - schedule: - # Safety net: runs Friday 07:00 UTC (~25h after loldle-data's Thursday job) - # in case the dispatch event was missed. - - cron: "0 7 * * 5" - -permissions: - contents: write - -jobs: - sync: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Download latest champions.json - run: | - curl -fsSL -o src/modules/loldle/champions.json.new \ - https://raw.githubusercontent.com/tiennm99/loldle-data/main/champions.json - - - name: Compare and replace - id: diff - run: | - if cmp -s src/modules/loldle/champions.json src/modules/loldle/champions.json.new; then - echo "No changes." - rm src/modules/loldle/champions.json.new - echo "changed=false" >> "$GITHUB_OUTPUT" - else - mv src/modules/loldle/champions.json.new src/modules/loldle/champions.json - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Regenerate champions-data.js - if: steps.diff.outputs.changed == 'true' - run: node scripts/build-loldle-data.js - - - name: Commit and push - if: steps.diff.outputs.changed == 'true' - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add src/modules/loldle/champions.json src/modules/loldle/champions-data.js - git commit -m "chore(loldle): sync champions.json from loldle-data" - git push