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