2023-07-18 14:56:01 +00:00
|
|
|
name: Crowdin / Download translations
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '17 4 * * *' # Every day
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
download-translations:
|
|
|
|
runs-on: ubuntu-latest
|
2023-10-17 12:59:39 +00:00
|
|
|
if: github.repository == 'mastodon/mastodon'
|
2023-07-18 14:56:01 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-11 08:41:26 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-18 14:56:01 +00:00
|
|
|
|
|
|
|
- name: Increase Git http.postBuffer
|
|
|
|
# This is needed due to a bug in Ubuntu's cURL version?
|
|
|
|
# See https://github.com/orgs/community/discussions/55820
|
|
|
|
run: |
|
|
|
|
git config --global http.version HTTP/1.1
|
|
|
|
git config --global http.postBuffer 157286400
|
|
|
|
|
|
|
|
# Download the translation files from Crowdin
|
|
|
|
- name: crowdin action
|
|
|
|
uses: crowdin/github-action@v1
|
|
|
|
with:
|
|
|
|
upload_sources: false
|
|
|
|
upload_translations: false
|
|
|
|
download_translations: true
|
|
|
|
crowdin_branch_name: main
|
|
|
|
push_translations: false
|
|
|
|
create_pull_request: false
|
|
|
|
env:
|
|
|
|
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}
|
|
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
|
|
|
|
# As the files are extracted from a Docker container, they belong to root:root
|
|
|
|
# We need to fix this before the next steps
|
|
|
|
- name: Fix file permissions
|
|
|
|
run: sudo chown -R runner:docker .
|
|
|
|
|
|
|
|
# This is needed to run the normalize step
|
2023-10-24 11:43:24 +00:00
|
|
|
- name: Set up Ruby environment
|
|
|
|
uses: ./.github/actions/setup-ruby
|
2023-07-18 14:56:01 +00:00
|
|
|
|
|
|
|
- name: Run i18n normalize task
|
|
|
|
run: bundle exec i18n-tasks normalize
|
|
|
|
|
|
|
|
# Create or update the pull request
|
|
|
|
- name: Create Pull Request
|
2024-04-22 08:13:28 +00:00
|
|
|
uses: peter-evans/create-pull-request@v6.0.4
|
2023-07-18 14:56:01 +00:00
|
|
|
with:
|
|
|
|
commit-message: 'New Crowdin translations'
|
|
|
|
title: 'New Crowdin Translations (automated)'
|
|
|
|
author: 'GitHub Actions <noreply@github.com>'
|
|
|
|
body: |
|
|
|
|
New Crowdin translations, automated with Github Actions
|
|
|
|
|
|
|
|
See `.github/workflows/crowdin-download.yml`
|
|
|
|
|
|
|
|
This PR will be updated every day with new translations.
|
|
|
|
|
|
|
|
Due to a limitation in Github Actions, checks are not running on this PR without manual action.
|
|
|
|
If you want to run the checks, then close and re-open it.
|
|
|
|
branch: i18n/crowdin/translations
|
|
|
|
base: main
|
|
|
|
labels: i18n
|