-
Notifications
You must be signed in to change notification settings - Fork 122
65 lines (52 loc) · 1.64 KB
/
locale-update.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
55
56
57
58
59
60
61
62
63
64
65
name: Update Locale
# This action runs:
# - When this file changes
# - When changes on documentation (doc)
# - When is triggered manually
on:
workflow_dispatch:
push:
permissions:
contents: read
jobs:
update-locale:
permissions:
contents: write # for Git to git push
name: Update Locale
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install apt packages
run: |
sudo apt-get install cmake cpanminus
sudo cpanm Text::SimpleTable::AutoWidth
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r ./requirements.txt
- name: Extract branch name and commit hash
run: |
branch=${GITHUB_REF#refs/heads/}
git_hash=$(git rev-parse --short "$GITHUB_SHA")
echo "GIT_HASH=$git_hash" >> $GITHUB_ENV
- name: Initialize mandatory git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Update locale
run: |
mkdir build
bash .github/scripts/update_locale.sh
# Add the files, commit and push
git diff --staged --quiet || git commit -m "Locale update: for commit ${{ env.GIT_HASH }}"
git restore . # Remove the unstaged changes before rebasing
git push