Skip to content

Commit 0ebc59a

Browse files
authored
Enhance PO check workflow with auto-wrap and Python setup
Updated the workflow to include auto-wrapping of PO files and Python setup. Changed job names and added a workflow dispatch trigger.
1 parent 472210a commit 0ebc59a

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

‎.github/workflows/po-check.yml‎

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
1-
name: Check PO Syntax
1+
name: Check PO Syntax & Auto-Wrap
22

33
on:
4-
pull_request:
5-
branches: [ "**" ]
64
push:
75
branches: [ "**" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
810

911
jobs:
10-
check-po:
12+
format-and-check:
1113
runs-on: ubuntu-latest
1214

1315
steps:
1416
- name: Checkout Code
1517
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.x"
25+
26+
- name: Install gettext & powrap
27+
run: |
28+
sudo apt-get update && sudo apt-get install -y gettext
29+
pip install powrap
30+
31+
- name: Auto-wrap PO files to 80 characters
32+
run: |
33+
find . -name "*.po" -exec powrap --quiet {} +
1634
17-
- name: Install gettext
18-
run: sudo apt-get update && sudo apt-get install -y gettext
35+
- name: Commit & Push formatted PO files
36+
uses: stefanzweifel/git-auto-commit-action@v5
37+
with:
38+
commit_message: "Auto-format PO files to 80 chars [skip ci]"
39+
file_pattern: "*.po"
1940

20-
- name: Validate PO files with msgfmt
41+
- name: Validate PO syntax with msgfmt
2142
run: |
2243
find . -name "*.po" -exec msgfmt --check --check-format -o /dev/null {} +

0 commit comments

Comments
 (0)