mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
name: Update Locales
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/setup-node@v1.1.0
|
|
with:
|
|
python-version: '10.x'
|
|
- name: Fetch changes from Tabula
|
|
run: |
|
|
format_script="let obj = JSON.parse(process.argv[1]); JSON.stringify(obj, Object.keys(obj).sort(), 4);"
|
|
node -p "$format_script" "$(curl 'https://tabulas.herokuapp.com/api/loot-table/en/')" > "locales/en.json"
|
|
node -p "$format_script" "$(curl 'https://tabulas.herokuapp.com/api/loot-table/ru/')" > "locales/ru.json"
|
|
node -p "$format_script" "$(curl 'https://tabulas.herokuapp.com/api/loot-table/zh-CN/')" > "locales/zh-CN.json"
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: Update locales
|
|
title: Update locales
|
|
author-name: Github Action
|
|
author-email: action@github.com
|
|
branch: locales
|
|
branch-suffix: short-commit-hash
|