-
Notifications
You must be signed in to change notification settings - Fork 16
51 lines (48 loc) · 1.64 KB
/
pull-translations.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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.