Skip to content

update-showdown-data #196

update-showdown-data

update-showdown-data #196

name: update-showdown-data
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: cerbottana
- name: Clone pokemon showdown
uses: actions/checkout@v4
with:
repository: smogon/pokemon-showdown
path: pokemon-showdown
- name: Set up node
uses: actions/setup-node@v4
- name: Build pokemon showdown
run: pokemon-showdown/build
- name: Download minidex files
run: |
wget -O pokedex-mini.js https://play.pokemonshowdown.com/data/pokedex-mini.js
wget -O pokedex-mini-bw.js https://play.pokemonshowdown.com/data/pokedex-mini-bw.js
- name: Update showdown data
run: |
echo 'const fs = require("fs");
const Sim = require("./pokemon-showdown");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/aliases.json", JSON.stringify(Sim.Dex.data.Aliases, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex.json", JSON.stringify(Sim.Dex.data.Pokedex, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex-mini.json", JSON.stringify(require("./pokedex-mini.js").BattlePokemonSprites, null, 2) + "\n");
fs.writeFileSync("cerbottana/cerbottana/data/showdown/pokedex-mini-bw.json", JSON.stringify(require("./pokedex-mini-bw.js").BattlePokemonSpritesBW, null, 2) + "\n");
' | node -
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
path: cerbottana
token: ${{ secrets.MACHINE_USER_PAT }}
push-to-fork: prnss/cerbottana
committer: prns <[email protected]>
author: prns <[email protected]>
commit-message: "Showdown: update data"
title: "Showdown: update data"
branch: showdown-update-data