action: Only commit translations on change

When there are no changes in weblate, do not attempt to add a commit.
This commit is contained in:
Marek Blaha 2023-11-24 14:15:11 +01:00 committed by Nicola Sella
parent 2198be9742
commit 906808bc09
1 changed files with 4 additions and 1 deletions

View File

@ -35,4 +35,7 @@ runs:
- name: Commit *.po files
shell: bash
run: |
git -c user.name='GitHub Workflow' -c user.email='github-actions@github.com' commit -m "Update translations from weblate"
# only commit if there is any change in translations
if ! git diff --staged --exit-code; then
git -c user.name='GitHub Workflow' -c user.email='github-actions@github.com' commit -m "Update translations from weblate"
fi