forked from zulip/zulip-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.74 KB
/
update-translations.yml
File metadata and controls
53 lines (47 loc) · 1.74 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Update translations from Weblate
permissions:
contents: write
pull-requests: write
on:
schedule:
- cron: "0 10 * * 1"
workflow_dispatch:
jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- name: Trigger a rebase in Weblate
run: |
pip install wlc
wlc --url https://hosted.weblate.org/api/ --key $WEBLATE_API_KEY pull zulip/zulip-flutter
env:
WEBLATE_API_KEY: ${{ secrets.WEBLATE_API_KEY }}
- uses: actions/checkout@v6
with:
# Enough such that even a still-out-of-date weblate will have shared history
fetch-depth: 50
- name: Fetch and merge from Weblate
# The commit message is generated in Weblate; see https://hosted.weblate.org/addon/17163/
run: |
git remote add weblate https://hosted.weblate.org/git/zulip/zulip-flutter/
git fetch weblate
# This may lag behind `main` if weblate is backlogged; this can
# theoretically cause the PR to not be able to auto-merged, though
# re-running the action once weblate has caught up should be
# sufficient to fix that.
git reset --hard weblate/main
- name: Clone Flutter SDK
run: tools/ci/clone-flutter-sdk
- name: Update generated code
run: |
mkdir -p build
tools/check l10n --fix
git add lib/generated/l10n/
GIT_COMMITTER_NAME="Hosted Weblate" GIT_COMMITTER_EMAIL="hosted@weblate.org" \
git commit --amend -C HEAD
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: update-translations/weblate
delete-branch: true
title: Update translations from Weblate