Skip to content

Export translations from Crowdin #288

Export translations from Crowdin

Export translations from Crowdin #288

name: Export translations from Crowdin
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
sync:
runs-on: ubuntu-latest
env:
TIMER_CROWDIN_AUTH: ${{ secrets.TIMER_CROWDIN_AUTH }}
steps:
- name: Prepare branch
uses: actions/checkout@v4
with:
fetch-depth: 1
token: ${{secrets.GITHUB_TOKEN}}
- name: Test using Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install
- name: Export translations
run: |
npx ts-node --project ./tsconfig.node.json ./script/crowdin/export-translation.ts 2>&1 | tee /tmp/export-output.log
exit ${PIPESTATUS[0]}
continue-on-error: true
- name: Check exporting logs
if: always()
run: |
if grep -q -F "[CROWDIN-ERROR]" /tmp/export-output.log; then
echo "::error:: Found errors in export logs"
exit 1
else
echo "No errors found in export logs"
fi
- name: Test typescript
if: success()
run: npx tsc --noEmit
- name: Create Pull Request
if: success()
uses: peter-evans/create-pull-request@v8
with:
commit-message: "i18n(download): download translations by bot"
branch: crowdin-export/patch
title: "i18n(download): download translations by bot"
body: "Automated download translations from [Crowdin](https://crowdin.com/project/timer-chrome-edge-firefox)"
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
sign-commits: true
labels: "i18n"