From 505122725a4179376c4c626d961bfb9489db8ff3 Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sun, 12 Jul 2020 19:21:52 +0800 Subject: [PATCH] chore(CI): Avoid failing if no update in the translation when doing the cron job. --- .drone.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 93b0f36..1fc4db3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -111,7 +111,7 @@ steps: event: - tag - - name: fetch-translate + - name: fetch-translation image: debian environment: TRADUORA_R_CLIENT: @@ -122,12 +122,15 @@ steps: - apt update && apt install -y git python3-requests hub - git branch bot-traduora && git checkout bot-traduora - (cd lang/ && ./sync_translation.py --client $TRADUORA_R_CLIENT --secret $TRADUORA_R_SECRET --fetch) - - git add lang/* && git status + - git add lang/* + - git status - git config --global user.email "github@azlux.fr" && git config --global user.name "azlux" - - "git commit -a -m 'Bot: update strings'" - - git remote set-url origin https://azlux:$GITHUB_API@github.com/azlux/botamusique/ - - git push --set-upstream origin new-translations && git push - - "GITHUB_USER=\"azlux\" GITHUB_TOKEN=\"$GITHUB_API\" hub pull-request -m \"Bot: TRADUORA Update\"" + - | + if git commit -a -m 'Bot: Update translation'; then + git remote set-url origin https://azlux:$GITHUB_API@github.com/azlux/botamusique/ + git push --set-upstream origin new-translations && git push + GITHUB_USER="azlux" GITHUB_TOKEN="$GITHUB_API" hub pull-request -m "Bot: TRADUORA Update" + fi when: event: - cron