-
-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (63 loc) · 2.39 KB
/
crowdin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Crowdin Action
on:
push:
paths:
- 'apps/app/public/locales/en/*.json'
pull_request:
types:
- closed
branches-ignore:
# - dev
- main
- l10n_**
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Remove Jira ticket ID from branch name
id: branchregex
uses: ashley-taylor/regex-property-action@eeec905bf940ec1c65ff777402c57f786368d9bc # v1.4
with:
value: ${{ github.ref_name }}
regex: (IN|PLI)-\d+
flags: gi
replacement: $1-xxx
- name: Sanitize github branch name
id: sanitizebranch
uses: ashley-taylor/regex-property-action@eeec905bf940ec1c65ff777402c57f786368d9bc # v1.4
with:
value: ${{ github.head_ref || github.ref_name}}
regex: '[\\/:*?"<>|>]'
flags: gi
replacement: '_'
- name: Upload to Crowdin
if: github.event_name != 'pull_request' && !startsWith(github.ref_name, 'l10n_')
uses: crowdin/github-action@ecdf564895766b8a6b4b581559b3c6cd955467d1 # v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GH_ACT_PAT }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
with:
upload_sources: true
upload_translations: false
download_translations: false
localization_branch_name: ${{ steps.branchregex.outputs.value }}
create_pull_request: true
pull_request_title: 'chore(i18n): Updated translations from Crowdin'
pull_request_labels: "translations, kodiak: merge.method = 'squash', automerge"
pull_request_base_branch_name: ${{ github.ref_name }}
crowdin_branch_name: ${{ steps.sanitizebranch.outputs.value }}
- name: Delete Crowdin Branch
if: github.event_name == 'pull_request'
uses: crowdin/github-action@ecdf564895766b8a6b4b581559b3c6cd955467d1 # v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GH_ACT_PAT }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
with:
upload_sources: false
upload_translations: false
download_translations: false
create_pull_request: false
command: branch delete
command_args: ${{ steps.sanitizebranch.outputs.value }}