summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorPino Toscano <ptoscano@redhat.com>2020-07-14 15:08:29 +0200
committerCole Robinson <crobinso@redhat.com>2020-07-14 11:58:41 -0400
commit8ec6ccbddb2bed8585d04ff2e466e097d7a2c828 (patch)
treefc9256f2009cdbb47135af956f738f7765ddb27e /.github
parent22fe62be34c73dbc82d5a24b9fa9dd10be35607e (diff)
downloadvirt-manager-8ec6ccbddb2bed8585d04ff2e466e097d7a2c828.tar.gz
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>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml24
1 files changed, 18 insertions, 6 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b0c7c266..14146370 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,7 +20,7 @@ jobs:
steps:
- name: Install deps
run: |
- dnf install -y python3-setuptools gettext git
+ dnf install -y python3-setuptools gettext git diffutils
- uses: actions/checkout@v2
with:
@@ -36,9 +36,21 @@ jobs:
git fetch --all
git rebase remotes/origin/translations
+ cp po/virt-manager.pot old.pot
./setup.py extract_messages
- git commit po/virt-manager.pot \
- --message "Refresh translation .pot template"
-
- remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
- git push "${remote_repo}" HEAD:translations
+ ec=0
+ 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"
+ git push "${remote_repo}" HEAD:translations
+ ;;
+ *)
+ echo "diff failed with exit status ${ec}" >&2
+ exit 1
+ ;;
+ esac