Add gh workflow for creating translations PR #772
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief description of what is fixed or changed
This PR adds a GitHub workflow for creating a pull request to add or update translations for a given language. It has a
workflow_dispatch
which accepts a Crowdin language code. The workflow clones thenumpy.org
repo, ensures that there are no merge conflicts between the translation branchl10n_main
andmain
, checks outl10n_main
and then does a scripted interactive rebase ontomain
which picks only commits for the language of interest. It uses scripts from the repo https://github.com/Scientific-Python-Translations/automations, primarily create_branch_for_language.sh to accomplish it's work.I've been testing this out on my fork, and have verified that it works there. See https://github.com/steppi/numpy.org/actions/runs/10646298865/job/29512984917, and steppi#6 for an instance of a PR generated by this workflow.
The goal here is to make it easier to create pull requests to add translations, moving something that was a bespoke thing I did on my local machine, to a push button thing anyone with the right permissions can do.
For this to work as is, the
GITHUB_TOKEN
needs to be given write permissions and permission to create pull requests in the actions settings, if it doesn't already have these permissions.cc @melissawm