-
Notifications
You must be signed in to change notification settings - Fork 400
44 lines (39 loc) · 1.28 KB
/
localization.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
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install node_modules
run: yarn install --frozen-lockfile --prefer-offline
- name: Extract locales
run: yarn extract-locales
- name: Inspect file
run: cat ./locale/templates/LC_MESSAGES/amo.pot
- id: diff
name: Diff changes
run: |
regex="([0-9]+) files changed, ([0-9]+) insertions\(\+\), ([0-9]+) deletions\(-\)"
output=$(git diff --shortstat)
files_changed=0
insertions=0
deletions=0
if [[ $output =~ $regex ]]; then
files_changed=${BASH_REMATCH[1]}
insertions=${BASH_REMATCH[2]}
deletions=${BASH_REMATCH[3]}
fi
if [[ files-changed > 1 ]]; then
echo "Something went wrong, expected only 1 file to change"
echo $output
exit 1
fi
echo "Files changed: $files_changed"
echo "Insertions: $insertions"
echo "Deletions: $deletions"