forked from uyuni-project/uyuni
-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (75 loc) · 2.65 KB
/
check_translations.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Check if translation is required
on:
pull_request_target:
paths:
- 'java/code/src/com/redhat/rhn/frontend/strings/**'
- 'backend/**'
- 'client/rhel/yum-rhn-plugin/**'
- 'client/rhel/mgr-daemon/**'
- 'client/rhel/spacewalk-client-tools/**'
- 'web/**'
- 'susemanager/**'
- 'spacecmd/**'
jobs:
run:
name: Check by trying to locally update translation files
if: github.repository == 'uyuni-project/uyuni'
runs-on: ubuntu-latest
steps:
- name: Setup tooling
run: sudo apt-get install -y make git gettext intltool python3
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Setup git
run: |
git config --global user.name "Galaxy CI"
git config --global user.email "galaxy-ci@suse.de"
- name: Checkout repo
uses: actions/checkout@v4
with:
path: 'master_repo'
- name: Update all translations files
run: |
cd master_repo
git switch -c check_translations
git branch origin_check_translations
ADDITIONAL_SAFE_BRANCHNAME=check_translations scripts/translation/update-all-translation-strings.sh
cd ..
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if there has been changes on translation files for master
run: |
cd master_repo
trs=$(git diff origin_check_translations check_translations | wc -l)
echo "Translations needed for master: ${trs}"
echo "translations_needed_for_master=${trs}" >> $GITHUB_ENV
cd ..
- name: Checkout PR repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: 'pr_repo'
- name: Update all translations files for PR
run: |
cd pr_repo
git switch -c check_translations
git branch origin_check_translations
ADDITIONAL_SAFE_BRANCHNAME=check_translations scripts/translation/update-all-translation-strings.sh
cd ..
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if there has been changes on translation files
run: |
cd pr_repo
trs=$(git diff origin_check_translations check_translations | wc -l)
echo "Translations needed for PR: ${trs}"
echo "translations_needed_for_PR=${trs}" >> $GITHUB_ENV
cd ..
- name: Add label
if: env.translations_needed_for_master != env.translations_needed_for_PR
uses: andymckay/labeler@1.0.4
with:
add-labels: "needs-translation"
repo-token: "${{ secrets.GITHUB_TOKEN }}"