-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (46 loc) · 1.57 KB
/
term_check.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
name: Terminology Update Check
on:
schedule:
- cron: '0 10 1,15 * *'
workflow_dispatch:
jobs:
checker:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install python dependencies
run: |
pip install -r .github/requirements.txt
- name: Check for term updates
run: |
python .github/scripts/terminology_update_check.py --locales .github/locales.txt --repo terminology/
- name: Create PR for updating terms in repo
if: ${{ failure() }}
run: |
# Only try to commit if there are pending changes
mv -f pontoon_exports/* terminology/
cd terminology
if [[ $(git diff --exit-code) || $(git ls-files --other --exclude-standard) ]]
then
UPDATE=$(date +'%Y-%m-%d')
git config --global user.email "38174554+bcolsson@users.noreply.github.com"
git config --global user.name "bcolsson"
git checkout -B "merge-terminology-$UPDATE"
git add .
git commit -m "Merge new terms as of $UPDATE"
git push -f origin "merge-terminology-$UPDATE"
# Create pull request, use the last commit message as title
gh pr create --fill
else
echo "No update required"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}