feat(tools): automatic crowdin prs (#41365)
* feat(tools): automatic crowdin prs Enables automatic PR creation on all download scripts. * feat: CRON everything * fix(tools): stagger workflows
This commit is contained in:
committed by
GitHub
parent
d58e605825
commit
4fe3828537
@ -1,6 +1,9 @@
|
|||||||
name: Crowdin Client UI Download
|
name: Crowdin Client UI Download
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# runs every day at 12:15 PM UTC
|
||||||
|
- cron: "15 12 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-download-client-ui-translations:
|
i18n-download-client-ui-translations:
|
||||||
@ -80,3 +83,38 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CLIENT }}
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CLIENT }}
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
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: 'chore(i18n,client): processed translations',
|
||||||
|
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: UI"
|
||||||
|
]
|
||||||
|
});
|
||||||
|
await github.pulls.requestReviewers({
|
||||||
|
owner: 'freeCodeCamp',
|
||||||
|
repo: 'freeCodeCamp',
|
||||||
|
pull_number: PRNumber,
|
||||||
|
reviewers: [
|
||||||
|
'RandellDawson',
|
||||||
|
'nhcarrigan'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
name: Crowdin Client UI Upload
|
name: Crowdin Client UI Upload
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# runs everyday at 11:15 AM UTC
|
||||||
|
- cron: "15 11 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-upload-client-ui-files:
|
i18n-upload-client-ui-files:
|
||||||
|
@ -2,8 +2,8 @@ name: Crowdin Curriculum Download
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# runs every day at 12:00 noon UTC
|
# runs every day at 12:30 PM UTC
|
||||||
- cron: "0 12 * * *"
|
- cron: "30 12 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-download-curriculum-translations:
|
i18n-download-curriculum-translations:
|
||||||
@ -96,7 +96,7 @@ jobs:
|
|||||||
repo: 'freeCodeCamp',
|
repo: 'freeCodeCamp',
|
||||||
head: 'i18n-sync-learn',
|
head: 'i18n-sync-learn',
|
||||||
base: 'main',
|
base: 'main',
|
||||||
title: 'Crowdin Sync Learn',
|
title: 'chore(i18n,learn): processed translations',
|
||||||
body: 'This PR was opened auto-magically by Crowdin.'
|
body: 'This PR was opened auto-magically by Crowdin.'
|
||||||
});
|
});
|
||||||
const PRNumber = PR.data.number;
|
const PRNumber = PR.data.number;
|
||||||
|
@ -2,8 +2,8 @@ name: Crowdin Curriculum Upload
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
# runs everyday at 11:00 AM UTC
|
# runs everyday at 11:30 AM UTC
|
||||||
- cron: "0 11 * * *"
|
- cron: "30 11 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-upload-curriculum-files:
|
i18n-upload-curriculum-files:
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
name: Crowdin Docs Download
|
name: Crowdin Docs Download
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# runs every day at 12:00 noon UTC
|
||||||
|
- cron: "0 12 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-download-docs-translations:
|
i18n-download-docs-translations:
|
||||||
@ -114,3 +117,38 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_DOCS }}
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_DOCS }}
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
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-docs',
|
||||||
|
base: 'main',
|
||||||
|
title: 'chore(i18n,docs): processed translations',
|
||||||
|
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: docs"
|
||||||
|
]
|
||||||
|
});
|
||||||
|
await github.pulls.requestReviewers({
|
||||||
|
owner: 'freeCodeCamp',
|
||||||
|
repo: 'freeCodeCamp',
|
||||||
|
pull_number: PRNumber,
|
||||||
|
reviewers: [
|
||||||
|
'RandellDawson',
|
||||||
|
'nhcarrigan'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
name: Crowdin Docs Upload
|
name: Crowdin Docs Upload
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
# runs everyday at 11:00 AM UTC
|
||||||
|
- cron: "0 11 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
i18n-upload-docs-files:
|
i18n-upload-docs-files:
|
||||||
|
Reference in New Issue
Block a user