-
Notifications
You must be signed in to change notification settings - Fork 289
38 lines (37 loc) · 1.38 KB
/
unlock-weblate.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
# Weblate is locked when a daily translations PR is created. Unlock Weblate
# when that PR gets closed (either as merged or rejected).
#
# We do this to avoid conflicts.
name: Unlock Weblate when PR is closed
on:
pull_request_target:
types:
- closed
jobs:
if_merged:
if:
github.event.pull_request.user.login == 'weblate' ||
contains(github.event.pull_request.labels.*.name, 'translations')
runs-on: ubuntu-latest
steps:
# These are all the same as in 'update-weblate.yml'
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.12
- name: Install Weblate Client
run: pip install wlc
- name: Prepare client config
run: |
echo '[weblate]' >> .weblate
echo 'url = https://hosted.weblate.org/api/' >> .weblate
echo 'translation = hedy' >> .weblate
echo '[keys]' >> .weblate
echo 'https://hosted.weblate.org/api/ = ${{ secrets.WEBLATE_API_KEY }}' >> .weblate
- run: |
# Have to lock each component individually. Not in the UI, but using the CLI we do.
set -x
for component in glossary adventures keywords quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc --debug unlock hedy/$component | sed 's/${{ secrets.WEBLATE_API_KEY }}/*****/g'
done
echo "All components unlocked!"