-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (40 loc) · 1.56 KB
/
auto_messages_pot.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
name: Auto updates messages.pot for readme_generator
on:
push:
branches: [main]
jobs:
pybabel:
name: Auto updates messages.pot for readme_generator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Save old messges.pot for diffing later
run: |
cd readme_generator/
cp messages.pot messages.pot.old
- name: Try to generate messages.pot
run: |
cd readme_generator/
pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot .
- name: Check if files changed
run: |
HAS_DIFF=$(python .github/diff_pot_files.py readme_generator/messages.pot.old readme_generator/messages.pot)
echo "HAS_DIFF=$HAS_DIFF" >> $GITHUB_ENV
- name: Create Pull Request
if: ${{ env.HAS_DIFF == 'true' }}
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Update messages.pot for readme_generator"
commit-message: "chore(readme_generator): update messages.pot"
body: |
This pull request has been generated using the command `pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot .`
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/auto_messages_pot