Merge pull request #10119 from tobiasd/2021.03-CHANGELOG
[friendica.git/.git] / .github / workflows / transifex.yml
1 name: Transifex
2 on: [push, pull_request]
3
4 jobs:
5   messages:
6     name: Check messages.po changes
7     runs-on: ubuntu-latest
8     steps:
9       - name: Install gettext
10         run: sudo apt-get install gettext
11
12       - name: Checkout
13         uses: actions/checkout@v2
14
15       - name: Run Xgettext
16         run: ./bin/run_xgettext.sh
17
18       - name: Check if messages.po needs an update
19         run: |
20           echo "::group::Check messages.po"
21           # Skip first 4 lines in possible diff, because they're header
22           # Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date"
23           if [[ $(git diff -U0 ./view/lang/C/messages.po | awk '!/@@|-"POT-Creation-Date|+"POT-Creation-Date|-#|+#/{print }' | wc -l) > 4 ]]; then
24             echo "::error file=messages.po::messages.po is out of date"
25             exit 1
26           else
27             echo "Nothing to update"
28           fi
29           echo "::endgroup::"
30         shell: bash