Skip to content

Commit f62223d

Browse files
authored
Merge pull request #28 from session-foundation/fix-auto-merge-submodule-pr
Fix auto push to main session-localisation pr
2 parents babd6ae + d0bf1bf commit f62223d

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

.github/workflows/check_for_crowdin_updates.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Check for Crowdin Updates
66

77
on:
88
schedule:
9-
- cron: '0 0 * * 1' # Every Monday at 12:00 AM UTC, which is 10:00 AM Melbourne time (AEST)
9+
- cron: '0 0 * * 1' # Every Monday at 12:00 AM UTC, which is 10:00 AM Melbourne time (AEST)
1010
workflow_dispatch:
1111
inputs:
1212
UPDATE_PULL_REQUESTS:
@@ -31,10 +31,8 @@ env:
3131
This PR includes the latest translations from Crowdin
3232
3333
Session uses the community-driven translation platform Crowdin for localization, anyone can contribute at https://getsession.org/translate
34-
PR_TARGET_BRANCH: feature/update-crowdin-translations
3534
3635
jobs:
37-
3836
fetch_translations:
3937
name: Download translations from crowdin
4038
runs-on: ubuntu-latest
@@ -167,8 +165,6 @@ jobs:
167165
if-no-files-found: warn
168166
retention-days: 7
169167

170-
171-
172168
build_localization_module:
173169
name: Build localization module strings
174170
needs: [parse_translations]
@@ -272,7 +268,6 @@ jobs:
272268
-x lint \
273269
-x test
274270
275-
276271
jobs_sync:
277272
name: Waiting for build jobs
278273

@@ -285,6 +280,9 @@ jobs:
285280
run: echo "Nothing to do here"
286281

287282
make_android_pr:
283+
env:
284+
PR_TARGET_BRANCH: feature/update-crowdin-translations
285+
288286
name: Make Android PR
289287
needs: [jobs_sync]
290288
runs-on: ubuntu-latest
@@ -316,6 +314,8 @@ jobs:
316314
delete-branch: true
317315

318316
make_localization_module_pr:
317+
env:
318+
PR_TARGET_BRANCH: main
319319
needs: [jobs_sync]
320320
name: Make Localization Module PR
321321
runs-on: ubuntu-latest
@@ -328,26 +328,28 @@ jobs:
328328
# don't provide a branch (ref) so it uses the default for that event
329329
- name: Checkout Localization Module
330330
uses: ./scripts/actions/checkout_localization_module
331+
with:
332+
token: ${{ secrets.CROWDIN_PR_TOKEN }}
331333

332334
- uses: actions/download-artifact@v4
333335
with:
334336
name: session-localization
335337
# Download to /generated folder in localization module repo
336338
path: "${{ github.workspace }}/module/generated"
337339

338-
- name: Create Localization Module Pull Request
339-
uses: peter-evans/create-pull-request@v6
340+
- name: Push directly to ${{ env.PR_TARGET_BRANCH }}
341+
uses: stefanzweifel/git-auto-commit-action@v5
340342
with:
341-
path: 'module'
342-
token: ${{ secrets.CROWDIN_PR_TOKEN }}
343-
title: ${{ env.PR_TITLE }}
344-
body: ${{ env.PR_DESCRIPTION }}
343+
repository: module
344+
commit_message: ${{ env.PR_TITLE }}
345345
branch: ${{ env.PR_TARGET_BRANCH }}
346-
commit-message: ${{ env.PR_TITLE }}
347-
delete-branch: true
348-
346+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
347+
commit_user_name: github-actions[bot]
348+
commit_user_email: github-actions[bot]@users.noreply.github.com
349349

350350
make_ios_pr:
351+
env:
352+
PR_TARGET_BRANCH: feature/update-crowdin-translations
351353
needs: [jobs_sync]
352354
name: Make iOS PR
353355
runs-on: ubuntu-latest
@@ -370,11 +372,10 @@ jobs:
370372
- name: Create iOS Pull Request
371373
uses: peter-evans/create-pull-request@v6
372374
with:
373-
path: 'ios'
375+
path: "ios"
374376
token: ${{ secrets.CROWDIN_PR_TOKEN }}
375377
title: ${{ env.PR_TITLE }}
376378
body: ${{ env.PR_DESCRIPTION }}
377379
branch: ${{ env.PR_TARGET_BRANCH }}
378380
commit-message: ${{ env.PR_TITLE }}
379381
delete-branch: true
380-

.github/workflows/notify_failure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Discord Failure Notification
22

33
on:
44
workflow_run:
5-
workflows:
5+
workflows:
66
- "Check for Crowdin Updates"
77
- "Test Failure Notification"
88
types:

actions/checkout_localization_module/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: 'Setup for all'
22
description: "Setup shared for all jobs"
3+
inputs:
4+
token:
5+
description: 'Token to use for checkout (required for push access)'
6+
required: false
7+
default: ${{ github.token }}
38
runs:
49
using: 'composite'
510
steps:
@@ -9,6 +14,7 @@ runs:
914
repository: 'session-foundation/session-localization'
1015
path: 'module'
1116
ref: 'main'
17+
token: ${{ inputs.token }}
1218

1319
- name: Remove existing strings
1420
shell: bash

crowdin/codegen_localization.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@
5858
("storevariant", "string"): "WithStoreVariant",
5959
("min", "string"): "WithMin",
6060
("max", "string"): "WithMax",
61+
("platform", "string"): "WithPlatform",
62+
("platform_account", "string"): "WithPlatformAccount",
63+
("platform_store", "string"): "WithPlatformStore",
64+
("device_type", "string"): "WithDeviceType",
65+
("action_type", "string"): "WithActionType",
66+
("current_plan_length", "string"): "WithCurrentPlanLength",
67+
("platform_store_other", "string"): "WithPlatformStoreOther",
68+
("price", "string"): "WithPrice",
69+
("percent", "string"): "WithPercent",
70+
("monthly_price", "string"): "WithMonthlyPrice",
71+
("build_variant", "string"): "WithBuildVariant",
72+
("activation_type", "string"): "WithActivationType",
73+
("entity", "string"): "WithEntity",
74+
("selected_plan_length_singular", "string"): "WithSelectedPlanLengthSingular",
75+
("selected_plan_length", "string"): "WithSelectedPlanLength",
76+
6177
}
6278

6379
LOCALE_KEY_MAPPING = {

0 commit comments

Comments
 (0)