1
0
Fork 0
ynh-apps_tools/.github/workflows/auto_messages_pot.yml
2024-09-14 12:00:12 +02:00

47 lines
1.6 KiB
YAML

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