Skip to content

Automatic Data Update #1077

Automatic Data Update

Automatic Data Update #1077

Workflow file for this run

name: Automatic Data Update
on:
schedule:
- cron: '0 2 * * *'
jobs:
DataUpdater:
name: Automatic Data Update
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
- name: Run Smogon Tiers updater
run: yarn au:tiers
- name: Run Learnsets updater
run: yarn au:learnsets
- name: Run prettier on the code
run: yarn format
- name: Commit any changes and create a pull request
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add .;
if ! git diff-index --quiet HEAD --; then
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git";
git config --local user.email "${GITHUB_EMAIL}";
git config --local user.name "${GITHUB_USER}";
git commit -sam "refactor: update data [skip publish]";
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
fi