-
Notifications
You must be signed in to change notification settings - Fork 19
39 lines (39 loc) · 1.63 KB
/
translations.yml
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
name: Translations
on:
push:
pull_request:
types: labeled
jobs:
sync-translations:
name: Extract translations and submit a PR
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'translations_update')
steps:
- name: Checkout module-translation-tool
uses: actions/[email protected]
with:
repository: PrestaShopCorp/module-translation-tool
ref: main
- name: Create config for module-translation-tool
run: |
ls
cp ./module.cfg.example ./module.cfg
sed -i 's#^MODULE_NAME.*#MODULE_NAME="ps_mbo"#g' ./module.cfg
sed -i 's#^GIT_REPO_USERNAME.*#GIT_REPO_USERNAME="PrestaShopCorp"#g' ./module.cfg
sed -i 's#^GIT_REPO_NAME.*#GIT_REPO_NAME="ps_mbo"#g' ./module.cfg
sed -i 's#^BRANCH.*#BRANCH="${{ github.head_ref }}"#g' ./module.cfg
- name: Setup git config
run: |
echo "${{ secrets.MODULE_TRANSLATION_TOOL_ACCESS_TOKEN }}"
git config --global user.name "Github Actions - Module translation tool"
git config --global user.email "<>"
git config --global credential.helper 'cache --timeout 3600'
git config --global url."https://oauth2:${{ secrets.MODULE_TRANSLATION_TOOL_ACCESS_TOKEN }}@github.com".insteadOf ssh://[email protected]
- run: composer install
- name: Extract translations and push
run: |
printenv
/bin/bash -eux ./scripts/extractCatalogue.sh
/bin/bash -eux ./scripts/pushAndCreatePullRequest.sh
env:
APP_GITHUB_TOKEN: ${{ secrets.MODULE_TRANSLATION_TOOL_ACCESS_TOKEN }}