Pull Translations #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Translations | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * 1' # On Mondays | |
env: | |
TUTOR_ROOT: ./.ci/ | |
jobs: | |
compile_translations: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install aspects | |
run: pip install . | |
- name: Install requirements | |
run: make requirements | |
- name: Mark for translation | |
run: make pull_translations | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Push branch | |
run: | | |
branch_name="bot/translations/${{ steps.date.outputs.date }}" | |
git fetch --prune origin | |
if git show-ref --quiet refs/remotes/origin/$branch_name; then | |
git push --delete origin $branch_name | |
fi | |
git checkout -b $branch_name || git checkout $branch_name | |
git push origin $branch_name | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }} | |
title: "chore(i18n): updating translations" | |
commit-message: "chore(i18n): updating translations on ${{ steps.date.outputs.date }}" | |
branch: "bot/translations/${{ steps.date.outputs.date }}" | |
add-paths: | | |
tutoraspects/ | |
base: main | |
body: | | |
Automated update of translations for assets on ${{ steps.date.outputs.date }}. | |
This pull request was automatically generated. |