[libgweather/style-check-feedback] fixup! ci: Post the style check output as a comment on the MR



commit 2c609931c8a20655e298d766967a2700d1d929cb
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 19 14:44:58 2021 +0100

    fixup! ci: Post the style check output as a comment on the MR

 .gitlab-ci/run-style-check.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci/run-style-check.sh b/.gitlab-ci/run-style-check.sh
index 2d7b8c8f..00fd627d 100755
--- a/.gitlab-ci/run-style-check.sh
+++ b/.gitlab-ci/run-style-check.sh
@@ -14,19 +14,19 @@ git diff -U0 --no-color "${newest_common_ancestor_sha}" libgweather/*.c libgweat
 )
 exit_status=$?
 
+[ ${exit_status} == 0 ] || exit ${exit_status}
+
 format_diff="$(<format-diff.log)"
 
 if [ -n "${format_diff}" ]; then
   echo \`\`\`diff > format-diff.log
   echo "${format_diff}" >> format-diff.log
   echo \`\`\` >> format-diff.log
-  exit 1
-  [ -z "$CI_MERGE_REQUEST_IID" ] && curl \
+  [ -n "$CI_MERGE_REQUEST_IID" ] && curl \
     --request POST \
     --header "Private-Token: $STYLE_CHECK_TOKEN" \
     -d @format-diff.log \
     https://gitlab.your-server.com/api/v4/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes 
\
     --insecure
+  exit 1
 fi
-
-exit ${exit_status}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]