1
0
Fork 0
ynh-apps_tools/.github/workflows/auto_messages_pot.yml
2024-06-02 21:18:06 +02:00

46 lines
1.6 KiB
YAML

name: Auto updates messages.pot for readme_generator
on:
push:
branches:
- master
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
- name: Install dependencies
run: |
cd tools/readme_generator/
pip install -r requirements.txt
- name: Save old messges.pot for diffing later
run: |
cd tools/readme_generator/
cp messages.pot messages.pot.old
- name: Try to generate messages.pot
run: |
cd tools/readme_generator/
pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot .
HAS_DIFF=$(python .github/diff_pot_files.py tools/readme_generator/messages.pot.old tools/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