name: Crowdin Curriculum Download on: workflow_dispatch: schedule: # runs every day at 12:00 noon UTC - cron: "0 12 * * *" jobs: i18n-download-curriculum-translations: name: Learn runs-on: ubuntu-18.04 steps: - name: Checkout Source Files uses: actions/checkout@v2 ##### Download Chinese ##### - name: Crowdin Download Chinese Translations uses: crowdin/github-action@master # options: https://github.com/crowdin/github-action/blob/master/action.yml with: # uploads upload_sources: false upload_translations: false auto_approve_imported: false import_eq_suggestions: false # downloads download_translations: true download_language: zh-CN skip_untranslated_files: true export_only_approved: true push_translations: false # pull-request create_pull_request: false # global options config: './config/crowdin/curriculum/crowdin.yml' base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }} # Uncomment below to debug # dryrun_action: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CURRICULUM }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }} ##### Download Espanol ##### - name: Crowdin Download Espanol Translations uses: crowdin/github-action@master # options: https://github.com/crowdin/github-action/blob/master/action.yml with: # uploads upload_sources: false upload_translations: false auto_approve_imported: false import_eq_suggestions: false # downloads download_translations: true download_language: es-EM skip_untranslated_files: true export_only_approved: true commit_message: 'chore(i8n,learn): processed translations' localization_branch_name: i18n-sync-learn push_translations: true # pull-request create_pull_request: false # global options config: './config/crowdin/curriculum/crowdin.yml' base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }} # Uncomment below to debug # dryrun_action: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CURRICULUM }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }} # Generate PR - all languages should go ABOVE this. # - name: Create PR uses: actions/github-script@v3 with: github-token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }} script: | const PR = await github.pulls.create({ owner: 'freeCodeCamp', repo: 'freeCodeCamp', head: 'i18n-sync-learn', base: 'main', title: 'Crowdin Sync Learn', body: 'This PR was opened auto-magically by Crowdin.' }); const PRNumber = PR.data.number; await github.issues.addLabels({ owner: 'freeCodeCamp', repo: 'freeCodeCamp', issue_number: PRNumber, labels: [ "crowdin-sync", "scope: i18n", "scope: learn" ] }); await github.pulls.requestReviewers({ owner: 'freeCodeCamp', repo: 'freeCodeCamp', pull_number: PRNumber, reviewers: [ 'RandellDawson', 'nhcarrigan' ] });