Skip to content

OAuth to Actions migration guide

Andrii Bodnar edited this page May 29, 2024 · 2 revisions

If you are using Crowdin's OAuth GitHub integration feature to sync files between the Crowdin project and the GitHub repository and want to migrate to the Crowdin GitHub Action please make sure to do:

  • If you're using a crowdin.yml file, you'll need to add preserve_hierarchy: true to keep the directory structure the same between Crowdin and GitHub (even if you weren't already using this setting in your existing OAuth integration) See the comment
  • localization_branch_name should be set to the existing git branch name you're using for Crowdin PRs. See #10
  • crowdin_branch_name should also be set

For example, if you have the following configuration file:

files:
  - source: /**/*.txt
    translation: /**/%two_letters_code%.txt

add the credentials:

project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN

files:
  - source: /**/*.txt
    translation: /**/%two_letters_code%.txt

Then create secrets CROWDIN_PROJECT_ID and CROWDIN_PERSONAL_TOKEN in your GitHub project: Settings > Secrets

And finally, create the workflow:

name: Crowdin Action

on:
  push:
    branches: [ master ]

jobs:
  synchronize-with-crowdin:
    runs-on: ubuntu-latest

    steps:

    - name: Checkout
      uses: actions/checkout@v4

    - name: crowdin action
      uses: crowdin/github-action@v2
      with:
        upload_translations: true
        download_translations: true
        crowdin_branch_name: 'github_action'
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
        CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

For more details see the discussions here

Clone this wiki locally