From dbcbf38b34f45c6bb4c172125156b2a698dae15e Mon Sep 17 00:00:00 2001 From: Misode Date: Thu, 26 Dec 2019 03:13:09 +0100 Subject: [PATCH] Create update_locales.yml --- .github/workflows/update_locales.yml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/update_locales.yml diff --git a/.github/workflows/update_locales.yml b/.github/workflows/update_locales.yml new file mode 100644 index 00000000..6b006fc2 --- /dev/null +++ b/.github/workflows/update_locales.yml @@ -0,0 +1,32 @@ +name: Update Locales + +on: + schedule: + - cron: '0 0 * * * *' + +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Fetch changes from Tabula + run: | + curl "https://tabulas.herokuapp.com/api/loot-table/en/" | python -m json.tool --sort-keys > "locales/en.json" + curl "https://tabulas.herokuapp.com/api/loot-table/ru/" | python -m json.tool --sort-keys > "locales/en.json" + curl "https://tabulas.herokuapp.com/api/loot-table/zh-CN/" | python -m json.tool --sort-keys > "locales/zh-CN.json" + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "Update locales" + - name: Create Pull Request + uses: peter-evans/create-pull-request@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + author-name: Github Action + author-email: action@github.com + title: Update locales