mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-14 06:54:51 -05:00
ci: commit the catalog only if changed
Compare the newly generated catalog with the old one: if it actually changed (i.e. there are changes beside the creation date), then push it to the 'translations' branch. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
committed by
Cole Robinson
parent
22fe62be34
commit
8ec6ccbddb
@@ -20,7 +20,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
dnf install -y python3-setuptools gettext git
|
dnf install -y python3-setuptools gettext git diffutils
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@@ -36,9 +36,21 @@ jobs:
|
|||||||
git fetch --all
|
git fetch --all
|
||||||
git rebase remotes/origin/translations
|
git rebase remotes/origin/translations
|
||||||
|
|
||||||
|
cp po/virt-manager.pot old.pot
|
||||||
./setup.py extract_messages
|
./setup.py extract_messages
|
||||||
git commit po/virt-manager.pot \
|
ec=0
|
||||||
--message "Refresh translation .pot template"
|
diff -q -I 'POT-Creation-Date' old.pot po/virt-manager.pot || ec=$?
|
||||||
|
case "${ec}" in
|
||||||
|
0) ;;
|
||||||
|
1)
|
||||||
|
git commit po/virt-manager.pot \
|
||||||
|
--message "Refresh translation .pot template"
|
||||||
|
|
||||||
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
git push "${remote_repo}" HEAD:translations
|
git push "${remote_repo}" HEAD:translations
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "diff failed with exit status ${ec}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user