-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (44 loc) · 1.61 KB
/
export-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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Export translations from prelude
on:
pull_request:
paths: [prelude.yaml]
push:
paths: [prelude.yaml]
jobs:
export:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m venv .venv
./.venv/bin/activate
pip install -r requirements.txt
- name: Run the export translations script
run: python scripts/export-translations.py
- name: Create patch containing changes
run: git diff > sync-translations.patch
- name: Record pull request head data
run: |
echo 'export PR_HEAD_URL="${{ github.event.pull_request.head.repo.clone_url }}"' > git_vars.sh
echo 'export PR_HEAD_REF="${{ github.event.pull_request.head.ref }}"' >> git_vars.sh
echo 'export COMMIT_MESSAGE="Export translations from prelude"' >> git_vars.sh
if: ${{ github.event_name == 'pull_request' }}
- name: Record push head data
run: |
echo 'export PR_HEAD_URL="${{ github.event.repository.clone_url }}"' > git_vars.sh
echo 'export PR_HEAD_REF="${{ github.event.ref }}"' >> git_vars.sh
echo 'export COMMIT_MESSAGE="Export translations from prelude"' >> git_vars.sh
if: ${{ github.event_name == 'push' }}
- name: Upload data
uses: actions/upload-artifact@v4
with:
name: sync-translations-data
path: |
sync-translations.patch
git_vars.sh