2021-01-25 03:09:57 +00:00
|
|
|
name: Crowdin Curriculum Download
|
2021-01-12 18:20:54 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2021-03-04 20:31:40 +00:00
|
|
|
schedule:
|
2021-03-05 03:54:17 +00:00
|
|
|
# runs every day at 12:30 PM UTC
|
|
|
|
- cron: "30 12 * * *"
|
2021-01-12 18:20:54 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
i18n-download-curriculum-translations:
|
|
|
|
name: Learn
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Source Files
|
|
|
|
uses: actions/checkout@v2
|
2021-01-21 06:00:16 +00:00
|
|
|
|
2021-02-17 02:11:42 +00:00
|
|
|
##### Download Chinese #####
|
|
|
|
- name: Crowdin Download Chinese Translations
|
2021-01-12 18:20:54 +00:00
|
|
|
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
|
2021-02-17 02:11:42 +00:00
|
|
|
download_language: zh-CN
|
2021-02-11 20:24:18 +00:00
|
|
|
skip_untranslated_files: true
|
2021-01-12 18:20:54 +00:00
|
|
|
export_only_approved: true
|
2021-01-21 06:00:16 +00:00
|
|
|
|
2021-02-17 02:11:42 +00:00
|
|
|
push_translations: false
|
2021-01-21 06:00:16 +00:00
|
|
|
|
2021-01-12 18:20:54 +00:00
|
|
|
# pull-request
|
2021-02-17 02:11:42 +00:00
|
|
|
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'
|
2021-02-05 06:41:41 +00:00
|
|
|
localization_branch_name: i18n-sync-learn
|
2021-02-17 02:11:42 +00:00
|
|
|
push_translations: true
|
|
|
|
|
|
|
|
# pull-request
|
2021-01-21 06:00:16 +00:00
|
|
|
create_pull_request: false
|
2021-01-12 18:20:54 +00:00
|
|
|
|
|
|
|
# global options
|
2021-02-10 18:06:13 +00:00
|
|
|
config: './config/crowdin/curriculum/crowdin.yml'
|
2021-01-12 18:20:54 +00:00
|
|
|
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 }}
|
2021-03-04 20:31:40 +00:00
|
|
|
|
|
|
|
# Generate PR - all languages should go ABOVE this. #
|
|
|
|
- name: Create PR
|
|
|
|
uses: actions/github-script@v3
|
|
|
|
with:
|
2021-03-04 22:46:34 +00:00
|
|
|
github-token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
2021-03-04 20:31:40 +00:00
|
|
|
script: |
|
|
|
|
const PR = await github.pulls.create({
|
|
|
|
owner: 'freeCodeCamp',
|
|
|
|
repo: 'freeCodeCamp',
|
|
|
|
head: 'i18n-sync-learn',
|
|
|
|
base: 'main',
|
2021-03-05 03:54:17 +00:00
|
|
|
title: 'chore(i18n,learn): processed translations',
|
2021-03-04 20:31:40 +00:00
|
|
|
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: [
|
2021-03-04 22:46:34 +00:00
|
|
|
'RandellDawson',
|
2021-03-04 20:31:40 +00:00
|
|
|
'nhcarrigan'
|
|
|
|
]
|
|
|
|
});
|