Skip to content

Commit 125c072

Browse files
Merge pull request #53 from raspberrypilearning/draft
Update github actions
2 parents 8e5e3b0 + 80f1198 commit 125c072

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

.github/workflows/download-translations.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
# Run every day at 1 AM UTC
66
- cron: "0 1 * * *"
77
workflow_dispatch: # Manual triggering
8+
inputs:
9+
language_code:
10+
description: 'Language code to download translations for (leave empty to download all languages)'
11+
required: false
12+
default: ''
13+
type: string
814

915
concurrency:
1016
group: crowdin-download
@@ -22,23 +28,46 @@ jobs:
2228
echo "Skipping Crowdin sync — no project ID set."
2329
exit 0
2430
fi
31+
2532
- name: Checkout
2633
uses: actions/checkout@v4
2734
with:
2835
ref: master
2936

30-
- name: Synchronize with Crowdin
37+
- name: Download all translations from Crowdin
3138
uses: crowdin/github-action@v2
3239
with:
33-
upload_sources: false
34-
upload_translations: false
40+
create_pull_request: true
41+
crowdin_branch_name: master
3542
download_translations: true
3643
localization_branch_name: l10n_crowdin_translations
37-
create_pull_request: true
38-
pull_request_title: "New Crowdin translations"
39-
pull_request_body: "New Crowdin pull request with translations"
4044
pull_request_base_branch_name: "master"
45+
pull_request_body: "New Crowdin pull request with translations"
46+
pull_request_title: "New Crowdin translations"
47+
upload_sources: false
48+
upload_translations: false
4149
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
4351
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
if: ${{ inputs.language_code == '' }}
54+
55+
- name: Download selected translations from Crowdin
56+
uses: crowdin/github-action@v2
57+
with:
58+
create_pull_request: true
59+
crowdin_branch_name: master
60+
download_language: ${{ inputs.language_code }}
61+
download_translations: true
62+
localization_branch_name: l10n_crowdin_translations-${{ inputs.language_code }}
63+
pull_request_base_branch_name: "master"
64+
pull_request_body: "New Crowdin pull request with translations"
65+
pull_request_title: "New Crowdin translations for ${{ inputs.language_code }}"
66+
upload_sources: false
67+
upload_translations: false
68+
env:
4469
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
70+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
if: ${{ inputs.language_code != '' }}
73+

.github/workflows/upload-sources.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919

20+
- name: Make sure CROWDIN_PROJECT_ID is set
21+
run: |
22+
if [ -z "${{ secrets.CROWDIN_PROJECT_ID }}" ]; then
23+
echo "CROWDIN_PROJECT_ID is not set. Please see instructions in CROWDIN.md"
24+
exit 1
25+
fi
26+
2027
- name: Crowdin push
2128
uses: crowdin/github-action@v2
2229
with:
30+
crowdin_branch_name: master
2331
upload_sources: true
2432
upload_translations: false
2533
download_translations: false

0 commit comments

Comments
 (0)