Download crowdin files #7954
This file contains hidden or 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: Download crowdin files | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| # Checkout + git push both authenticate with BOT_TOKEN, so GITHUB_TOKEN only needs read. | |
| permissions: | |
| contents: read | |
| jobs: | |
| download-from-crowdin: | |
| name: Download sources from Crowdin | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'aave/interface' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| token: ${{ secrets.BOT_TOKEN }} | |
| - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
| - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'pnpm' | |
| - name: crowdin action | |
| uses: crowdin/github-action@60debf382ee245b21794321190ad0501db89d8c1 # v2.13.0 | |
| with: | |
| project_id: 502668 | |
| token: ${{ secrets.CROWDIN_TOKEN }} | |
| upload_translations: false | |
| download_translations: true | |
| create_pull_request: false | |
| push_translations: false | |
| config: 'crowdin.yml' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} | |
| - name: check diff | |
| run: | | |
| if [[ -z $(git status -s) ]] | |
| then | |
| echo "tree is clean" | |
| else | |
| pnpm install --frozen-lockfile | |
| pnpm i18n:compile | |
| git add . | |
| git config --global user.name 'Crowdin bot' | |
| git config --global user.email 'crowdin-bot@aave.com' | |
| git commit -am "chore(i18n): synchronize translations from crowdin [skip cypress]" | |
| git push | |
| exit | |
| fi |