Commit 65d7631 1 parent f28af70 commit 65d7631 Copy full SHA for 65d7631
File tree 3 files changed +56
-5
lines changed
3 files changed +56
-5
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,20 @@ if [ ! -f .tx/config ]; then
15
15
exit 1
16
16
fi
17
17
18
- echo " Pushing translation source file to Transifex..."
19
- tx push -s
18
+ if [ " $1 " == " push" ]; then
19
+ echo " Pushing translation source file to Transifex..."
20
+ tx push -s
21
+ elif [ " $1 " == " pull" ]; then
22
+ echo " Pulling translations from Transifex..."
23
+ tx pull -t -s --mode reviewed --use-git-timestamps
24
+ else
25
+ echo " Invalid operation. Please specify either 'push' or 'pull'."
26
+ exit 1
27
+ fi
20
28
21
29
if [ $? -ne 0 ]; then
22
- echo " Error: Transifex push failed. Please check the error message above."
30
+ echo " Error: Transifex operation failed. Please check the error message above."
23
31
exit 1
24
32
else
25
- echo " Translation source file successfully pushed to Transifex ."
33
+ echo " Transifex operation completed successfully."
26
34
fi
Original file line number Diff line number Diff line change 42
42
tags : bahmni/clinic-config:${{env.ARTIFACT_VERSION}},bahmni/clinic-config:latest
43
43
- name : Push Translations to Transifex
44
44
run : |
45
- bash .github/scripts/transifex.sh
45
+ bash .github/scripts/transifex.sh push
46
46
env :
47
47
TX_TOKEN : ${{ secrets.TX_TOKEN }}
48
48
- name : Pull Bahmni Default Config Helm Chart
Original file line number Diff line number Diff line change
1
+ name : Pull Translations from Transifex
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 0 1 * *'
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ pull-translations :
10
+ name : Pull Translations from Transifex
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ contents : write
14
+
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v3
18
+
19
+ - name : Pull Translations from Transifex
20
+ run : |
21
+ bash .github/scripts/transifex.sh pull
22
+ env :
23
+ TX_TOKEN : ${{ secrets.TX_TOKEN }}
24
+
25
+ - name : Commit and push changes
26
+ id : auto-commit-action
27
+ uses : stefanzweifel/git-auto-commit-action@v4
28
+ with :
29
+ commit_message : " [Bahmni Infra] | Add. Update Translation Resources"
30
+ branch : ${{ github.ref }}
31
+ file_pattern : ' openmrs/i18n/**/*.json'
32
+ repository : .
33
+ commit_user_name : Bahmni Infra
34
+ commit_user_email : infrastructure@bahmni.org
35
+ commit_author : bahmni-infra <infrastructure@bahmni.org>
36
+
37
+ - name : Check for changes
38
+ run : |
39
+ if [[ steps.auto-commit-action.outputs.changes_detected == 'true' ]]; then
40
+ echo "Changes Detected. Translation Resources Updated."
41
+ else
42
+ echo "No Changes Detected. Project Already Up-To-Date."
43
+ fi
You can’t perform that action at this time.
0 commit comments