crowdin-download.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. if: github.repository == 'mastodon/mastodon'
  13. steps:
  14. - name: Checkout
  15. uses: actions/checkout@v4
  16. - name: Increase Git http.postBuffer
  17. # This is needed due to a bug in Ubuntu's cURL version?
  18. # See https://github.com/orgs/community/discussions/55820
  19. run: |
  20. git config --global http.version HTTP/1.1
  21. git config --global http.postBuffer 157286400
  22. # Download the translation files from Crowdin
  23. - name: crowdin action
  24. uses: crowdin/github-action@v1
  25. with:
  26. upload_sources: false
  27. upload_translations: false
  28. download_translations: true
  29. crowdin_branch_name: main
  30. push_translations: false
  31. create_pull_request: false
  32. env:
  33. CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
  34. CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
  35. # As the files are extracted from a Docker container, they belong to root:root
  36. # We need to fix this before the next steps
  37. - name: Fix file permissions
  38. run: sudo chown -R runner:docker .
  39. # This is needed to run the normalize step
  40. - name: Set up Ruby environment
  41. uses: ./.github/actions/setup-ruby
  42. - name: Run i18n normalize task
  43. run: bundle exec i18n-tasks normalize
  44. # Create or update the pull request
  45. - name: Create Pull Request
  46. uses: peter-evans/create-pull-request@v6.0.5
  47. with:
  48. commit-message: 'New Crowdin translations'
  49. title: 'New Crowdin Translations (automated)'
  50. author: 'GitHub Actions <noreply@github.com>'
  51. body: |
  52. New Crowdin translations, automated with GitHub Actions
  53. See `.github/workflows/crowdin-download.yml`
  54. This PR will be updated every day with new translations.
  55. Due to a limitation in GitHub Actions, checks are not running on this PR without manual action.
  56. If you want to run the checks, then close and re-open it.
  57. branch: i18n/crowdin/translations
  58. base: main
  59. labels: i18n