1
0

crowdin-download-stable.yml 2.4 KB

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