[Crowdin] Download translations #43
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: "[Crowdin] Download translations" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" # every day at midnight | |
| permissions: | |
| contents: write # required to push changes | |
| jobs: | |
| download-crowdin-translations: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Obtain token | |
| id: obtainToken | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| private-key: ${{ secrets.CROWDIN_APP_PRIVATE_KEY }} | |
| app-id: ${{ secrets.CROWDIN_APP_ID }} | |
| permission-contents: write # required to commit to crowdin branch | |
| permission-pull-requests: write # required to create pull request | |
| - name: Download Crowdin translations | |
| id: crowdin-download | |
| uses: crowdin/github-action@v2 | |
| with: | |
| upload_sources: false | |
| upload_translations: false | |
| download_translations: true | |
| localization_branch_name: crowdin | |
| create_pull_request: true | |
| pull_request_title: "chore(lang): updated translations from crowdin" | |
| pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)" | |
| commit_message: "chore(lang): update translations from crowdin" | |
| pull_request_base_branch_name: "dev" | |
| github_user_name: "Crowdin Homarr" | |
| github_user_email: "190541745+homarr-crowdin[bot]@users.noreply.github.com" | |
| skip_untranslated_strings: true | |
| env: | |
| GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }} | |
| CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | |
| CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
| - name: Enable auto-merge | |
| if: steps.crowdin-download.outputs.pull_request_number != '' && steps.crowdin-download.outputs.pull_request_number != null | |
| env: | |
| GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }} | |
| run: | | |
| gh pr merge ${{steps.crowdin-download.outputs.pull_request_number}} --auto --squash --delete-branch --subject "chore(lang): updated translations from crowdin" |