Update Translations #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Translations | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 00:00 on Sunday. | |
- cron: '0 0 * * 0' | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-translations: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Build Node.js cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}" | |
restore-keys: "${{ runner.os }}-node" | |
- name: Install dependencies | |
run: npm ci | |
- name: Update locales data | |
run: | | |
curl -H 'X-API-KEY: ${{ secrets.TOLGEE_TOKEN }}' 'https://app.tolgee.io/v2/projects/export' -o locales.zip | |
rm ./src/locales/* | |
unzip -o -d ./src/locales locales.zip | |
rm locales.zip | |
- name: Update locales metadata | |
uses: VueTorrent/tolgee-action@v1 | |
with: | |
tolgee_secret: ${{ secrets.TOLGEE_TOKEN }} | |
- name: Lint | |
run: npm run lint | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
base: master | |
commit-message: 'chore: update translations' | |
branch: 'update-tolgee-translations' | |
title: 'chore: update translations' | |
delete-branch: true |