-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to trigger a daily Weblate update
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Get Weblate to commit and push changes to a PR, | ||
# which will be auto-approved. | ||
name: Update Weblate | ||
|
||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
# 6 in the morning | ||
- cron: '0 6 * * *' | ||
|
||
jobs: | ||
update-weblate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- 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 '[keys]' >> .weblate | ||
echo 'https://hosted.weblate.org/api/ = ${{ secrets.WEBLATE_API_KEY }}' >> .weblate | ||
- name: Weblate commands | ||
run: | | ||
wlc changes hedy | ||
wlc reset | ||
wlc pull | ||
wlc commit | ||
wlc push | ||