Skip to content

Add files via upload #25

Add files via upload

Add files via upload #25

name: Update Translations
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
update-translations:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# with:
# persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install gettext (msgmerge, msgfmt)
run: |
sudo apt-get update
sudo apt-get install -y gettext
- name: Run translation updaters
run: |
for pyfile in $(find . -type f -name "update_translations.py"); do
plugin_dir=$(dirname "$pyfile")
echo "Running translation updater in $plugin_dir"
cd "$plugin_dir"
python3 update_translations.py
# Forza l'aggiunta dei file locale generati (ignora .gitignore)
if [ -d locale ]; then
git add -f locale/
fi
cd - > /dev/null
done
- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
if ! git diff --cached --quiet; then
git commit -m "Update translations via workflow"
git pull --rebase origin main
git push origin main
else
echo "No changes to commit"
fi