From 143c7e4131a24bf45af5a459a5f248b3a722a4f0 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Thu, 2 Jan 2020 22:05:09 +0100 Subject: [PATCH] [chore] Prevent useless POT updates (#5734) If only 1 line changed, it's just the timestamp. Otherwise every commit in the main repo will result in a useless one in koreader/koreader-translations, such as . --- .ci/after_success.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.ci/after_success.sh b/.ci/after_success.sh index 930281e9a..ac8af06b1 100755 --- a/.ci/after_success.sh +++ b/.ci/after_success.sh @@ -13,10 +13,13 @@ if [ -z "${CIRCLE_PULL_REQUEST}" ] && [ "${CIRCLE_BRANCH}" = 'master' ]; then make pot pushd l10n && { git checkout master - git -c user.name="KOReader build bot" -c user.email="non-reply@koreader.rocks" \ - commit templates/koreader.pot -m "Updated translation source file" - git push --quiet "https://${TRANSLATIONS_GITHUB_TOKEN}@github.com/koreader/koreader-translations.git" master - echo -e "\\n${ANSI_GREEN}Translation update pushed." + # If only one line was added and removed, it was just the timestamp. + git diff --numstat | grep "1[[:space:]]1[[:space:]]templates/koreader.pot" && echo -e "\\n${ANSI_GREEN}No updated translations found." || { + git -c user.name="KOReader build bot" -c user.email="non-reply@koreader.rocks" \ + commit templates/koreader.pot -m "Updated translation source file" + git push --quiet "https://${TRANSLATIONS_GITHUB_TOKEN}@github.com/koreader/koreader-translations.git" master + echo -e "\\n${ANSI_GREEN}Translation update pushed." + } } && popd || exit echo -e "\\n${ANSI_GREEN}Checking out koreader/doc for update."