fix(tools): set crowdin cron job (#41361)

Co-authored-by: Mrugesh Mohapatra <me@raisedadead.com>
pull/41362/head
Nicholas Carrigan (he/him) 2021-03-04 12:31:40 -08:00 committed by GitHub
parent aff0ea700d
commit fa6b11f359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -1,6 +1,9 @@
name: Crowdin Curriculum Download
on:
workflow_dispatch:
schedule:
# runs every day at 12:00 noon UTC
- cron: "0 12 * * *"
jobs:
i18n-download-curriculum-translations:
@ -81,3 +84,37 @@ jobs:
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.GITHUB_ACTIONS_CAMPERBOT_PA_TOKEN }}
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: [
'nhcarrigan'
]
});

View File

@ -1,6 +1,9 @@
name: Crowdin Curriculum Upload
on:
workflow_dispatch:
schedule:
# runs everyday at 11:00 AM UTC
- cron: "0 11 * * *"
jobs:
i18n-upload-curriculum-files: