Skip to content

Commit 0cb5232

Browse files
author
Suguru Hirahara
committed
Add GitHub Action "Update translations"
This commit implements a GitHub Action to update translation files with the PR automatically created on behalf of "github-actions[bot]", so that manual intervention and inflating activity of a committer is avoided. For now, only catalog templates (POT) files will be updated based on the master branch. When we start publishing translations, we can have the action build them. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
1 parent 2842276 commit 0cb5232

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
2+
#
3+
# SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+
---
6+
name: Update translations
7+
8+
on: # yamllint disable-line rule:truthy
9+
push:
10+
branches:
11+
- master
12+
paths: # See include_patterns on conf.py
13+
- 'docs/*.md'
14+
- 'i18n/README.md'
15+
- '*.md'
16+
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
jobs:
22+
update:
23+
if: github.repository == 'spantaleev/matrix-docker-ansible-deploy'
24+
name: Update translations
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.13'
32+
33+
# Setting up recommended prerequisites
34+
# See: i18n/README.md
35+
- uses: astral-sh/setup-uv@v5.1.0
36+
- uses: extractions/setup-just@v2
37+
38+
# TODO: optimize when we start publishing translations and integrate a Weblate instance
39+
- name: Update translation catalog templates (POT) files
40+
run: just --justfile i18n/justfile extract-translation-templates
41+
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v7.0.5
44+
with:
45+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> # Same as committer
46+
body: This is an automatic pull request to update translation files.
47+
branch: create-pull-request/i18n
48+
commit-message: Automatic translations update
49+
delete-branch: true
50+
labels: docs
51+
sign-commits: true
52+
title: Automatic translations update

0 commit comments

Comments
 (0)