-
Notifications
You must be signed in to change notification settings - Fork 154
43 lines (40 loc) · 1.38 KB
/
gettext.yaml
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
# SPDX-FileCopyrightText: 2023 Carmen Bianca BAKKER <carmenbianca@fsfe.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Update .pot file
on:
push:
branches:
- main
paths:
- "src/reuse/**.py"
jobs:
create-pot:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
# The main branch is protected. fsfe-system has been granted an
# exception to the branch protection, so we'll use that account's
# token to push to the main branch.
token: ${{ secrets.FSFE_SYSTEM_TOKEN }}
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Create .pot file
run: make create-pot
# Normally, POT-Creation-Date changes in two locations. Check if the diff
# includes more than just those two lines.
- name: Check if sufficient lines were changed
id: diff
run:
echo "changed=$(git diff -U0 | grep '^[+|-][^+|-]' | grep -Ev
'^[+-]"POT-Creation-Date' | wc -l)" >> $GITHUB_OUTPUT
- name: Commit and push updated reuse.pot
if: ${{ steps.diff.outputs.changed != '0' }}
run: |
git config --global user.name "fsfe-system"
git config --global user.email "<>"
git add po/reuse.pot po/*.po
git commit -m "Update reuse.pot"
git push origin main