Переглянути джерело

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>
pull/3907/head
Suguru Hirahara 2 місяці тому
committed by Suguru Hirahara
джерело
коміт
d94cc5afc5
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: E4F9743DAB4B7B75
1 змінених файлів з 52 додано та 0 видалено
  1. +52
    -0
      .github/workflows/update-translations.yml

+ 52
- 0
.github/workflows/update-translations.yml Переглянути файл

@@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2024 Suguru Hirahara
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---
name: Update translations

on: # yamllint disable-line rule:truthy
push:
branches:
- master
paths: # See include_patterns on conf.py
- 'docs/*.md'
- 'i18n/README.md'
- '*.md'

permissions:
contents: write
pull-requests: write

jobs:
update:
if: github.repository == 'spantaleev/matrix-docker-ansible-deploy'
name: Update translations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: '3.13'

# Setting up recommended prerequisites
# See: i18n/README.md
- uses: astral-sh/setup-uv@v7
- uses: extractions/setup-just@v3

# TODO: optimize when we start publishing translations and integrate a Weblate instance
- name: Update translation catalog templates (POT) files
run: just --justfile i18n/justfile extract-translation-templates

- name: Create Pull Request
uses: peter-evans/create-pull-request@v8.1.0
with:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> # Same as committer
body: This is an automatic pull request to update translation files.
branch: create-pull-request/i18n
commit-message: Automatic translations update
delete-branch: true
labels: docs
sign-commits: true
title: Automatic translations update

Завантаження…
Відмінити
Зберегти