crowdin-download.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Crowdin / Download translations
  2. on:
  3. schedule:
  4. - cron: '17 4 * * *' # Every day
  5. workflow_dispatch:
  6. permissions:
  7. contents: write
  8. pull-requests: write
  9. jobs:
  10. download-translations:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v3
  15. - name: Increase Git http.postBuffer
  16. # This is needed due to a bug in Ubuntu's cURL version?
  17. # See https://github.com/orgs/community/discussions/55820
  18. run: |
  19. git config --global http.version HTTP/1.1
  20. git config --global http.postBuffer 157286400
  21. # Download the translation files from Crowdin
  22. - name: crowdin action
  23. uses: crowdin/github-action@v1
  24. with:
  25. upload_sources: false
  26. upload_translations: false
  27. download_translations: true
  28. crowdin_branch_name: main
  29. push_translations: false
  30. create_pull_request: false
  31. env:
  32. CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
  33. CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
  34. # As the files are extracted from a Docker container, they belong to root:root
  35. # We need to fix this before the next steps
  36. - name: Fix file permissions
  37. run: sudo chown -R runner:docker .
  38. # This is needed to run the normalize step
  39. - name: Install native Ruby dependencies
  40. run: sudo apt-get install -y libicu-dev libidn11-dev
  41. - name: Set up Ruby
  42. uses: ruby/setup-ruby@v1
  43. with:
  44. ruby-version: .ruby-version
  45. bundler-cache: true
  46. - name: Run i18n normalize task
  47. run: bundle exec i18n-tasks normalize
  48. # Create or update the pull request
  49. - name: Create Pull Request
  50. uses: peter-evans/create-pull-request@v5.0.2
  51. with:
  52. commit-message: 'New Crowdin translations'
  53. title: 'New Crowdin Translations (automated)'
  54. author: 'GitHub Actions <noreply@github.com>'
  55. body: |
  56. New Crowdin translations, automated with Github Actions
  57. See `.github/workflows/crowdin-download.yml`
  58. This PR will be updated every day with new translations.
  59. Due to a limitation in Github Actions, checks are not running on this PR without manual action.
  60. If you want to run the checks, then close and re-open it.
  61. branch: i18n/crowdin/translations
  62. base: main
  63. labels: i18n