1
0
Fork 0
ynh-apps_tools/.github/workflows/auto_messages_pot.yml

48 lines
1.6 KiB
YAML
Raw Normal View History

2024-03-25 01:18:58 +01:00
name: Auto updates messages.pot for readme_generator
2024-09-13 15:46:58 +02:00
2024-03-25 01:18:58 +01:00
on:
push:
2024-09-13 15:46:58 +02:00
branches: [main]
2024-03-25 01:18:58 +01:00
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
2024-03-25 01:18:58 +01:00
uses: actions/setup-python@v5
with:
python-version: 3.11
2024-09-13 15:45:12 +02:00
cache: pip
2024-03-25 01:18:58 +01:00
- name: Install dependencies
2024-09-13 15:45:12 +02:00
run: pip install -r requirements.txt
- name: Save old messges.pot for diffing later
run: |
2024-09-13 15:45:12 +02:00
cd readme_generator/
cp messages.pot messages.pot.old
2024-03-25 01:18:58 +01:00
- name: Try to generate messages.pot
run: |
2024-09-13 15:45:12 +02:00
cd readme_generator/
2024-03-25 01:18:58 +01:00
pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot .
2024-06-02 21:20:23 +02:00
- name: Check if files changed
run: |
2024-09-13 15:45:12 +02:00
HAS_DIFF=$(python .github/diff_pot_files.py readme_generator/messages.pot.old readme_generator/messages.pot)
echo "HAS_DIFF=$HAS_DIFF" >> $GITHUB_ENV
2024-03-25 01:18:58 +01:00
- name: Create Pull Request
if: ${{ env.HAS_DIFF == 'true' }}
2024-03-25 01:18:58 +01:00
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