-
-
Notifications
You must be signed in to change notification settings - Fork 115
38 lines (32 loc) · 1.1 KB
/
sync_to_weblate.yml
File metadata and controls
38 lines (32 loc) · 1.1 KB
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
name: Sync English strings to Weblate branch
on:
push:
branches:
- beta
jobs:
sync-english:
runs-on: ubuntu-latest
steps:
- name: Checkout weblate branch
uses: actions/checkout@v4
with:
ref: weblate
fetch-depth: 0
token: ${{ secrets.PUSH_TOKEN }}
- name: Configure Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Sync English directories from main branch
run: |
DIRECTORIES=("app/src/main/res/values/strings.xml" "fastlane/metadata/android/en-US")
MAIN_BRANCH="beta"
WEBLATE_BRANCH="weblate"
REMOTE="origin"
MAIN_HASH=$(git rev-parse $REMOTE/$MAIN_BRANCH)
git checkout $REMOTE/$MAIN_BRANCH -- "${DIRECTORIES[@]}"
if ! git diff --quiet HEAD -- "${DIRECTORIES[@]}"; then
git add "${DIRECTORIES[@]}"
git commit -m "Sync English directories from $MAIN_HASH"
git push $REMOTE $WEBLATE_BRANCH
fi