Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Split Weblate PR commits into seperate branches #31369

@jonkoops

Description

@jonkoops

Currently Weblate provides a PR that adds a commit per language (squashed). This is problematic as we still want to review contributions per language before merging them in, effectively limiting contributions to one language per time.

In order to resolve this we want to invest in some automation to split this PR into separate PRs per language to accommodate our workflow. The proposal is as follows:

Write a GitHub action that will trigger on pull_request, this is then further filtered down to only PRs targeting the main branch and only targeting .properties files (which contain our translations), for example:

on:
  pull_request:
    branches:
      - main
    paths:
      - **messages_*.properties

Then only if the PR is triggered from the Weblate fork of Keycloak will the workflow be allowed to continue. When continuing the workflow the following should happen:

Each commit in the Weblate PR should be cherry-picked onto a branch per language. This language code is stored in the following format in the commit:

Language: de

If a branch already exists it can be first reset to the latest HEAD of main and the commit can be applied on top and force pushed to the remote. Once a all branches have been pushed to the remote a PR should be opened for each if not already.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions