Skip to content

Commit 94b28b9

Browse files
committed
Add first draft of workflow for creating translations PR
1 parent d16a68e commit 94b28b9

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/auto-translations-pr.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ jobs:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333
run: |
3434
cd numpy.org
35-
../automations/scripts/create_branch_for_language.sh numpy main l10n_main ${{ github.event.inputs.language_code }}
35+
branch_name=$(../automations/scripts/create_branch_for_language.sh numpy main l10n_main ${{ github.event.inputs.language_code }})
36+
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
3637
working-directory: ./numpy.org
3738

38-
- name: Create Pull Request
39-
if: env.CONTENT_CHANGED == 'true'
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
run:
43-
gh pr create --base main --head ${{ env.BRANCH_NAME }} --title "Update translations for X" --body "Body goes here."
44-
working-directory: ./numpy.org
39+
- name: Create Pull Request
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
language_name=$(../automations/scripts/get_language_name.sh ${{ github.event.inputs.language_code }})
44+
gh pr create --base main --head ${{ env.BRANCH_NAME }} --title "Update translations for $language_name" \
45+
--body "This PR to update translations for $language_name was generated by the GitHub workflow, \
46+
`auto-translations-pr.yml` and includes all commits from this repo's Crowdin branch for the language \
47+
of interest. A final check of the rendered docs is needed to identify if there are any formatting \
48+
errors due to incorrect string segmentation by Crowdin. If there are such formatting errors, they \
49+
should be fixed directly on this branch, not through Crowdin.")
50+
working-directory: ./numpy.org

0 commit comments

Comments
 (0)