This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new b103002  YETUS-1007. Logging when adding GitHub commit statuses (#139)
b103002 is described below

commit b103002eef0d7dcc9cab3e469f386fd6308050a6
Author: Akira Ajisaka <aajis...@apache.org>
AuthorDate: Tue Sep 29 23:39:37 2020 +0900

    YETUS-1007. Logging when adding GitHub commit statuses (#139)
    
    Signed-off-by: Allen Wittenauer <a...@apache.org>
---
 precommit/src/main/shell/test-patch.d/github.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/precommit/src/main/shell/test-patch.d/github.sh 
b/precommit/src/main/shell/test-patch.d/github.sh
index d303829..20325aa 100755
--- a/precommit/src/main/shell/test-patch.d/github.sh
+++ b/precommit/src/main/shell/test-patch.d/github.sh
@@ -704,6 +704,7 @@ function github_status_write()
 {
   declare filename=$1
   declare -a githubauth
+  declare retval=0
 
   if [[ -n "${GITHUB_TOKEN}" ]]; then
     githubauth=(-H "Authorization: token ${GITHUB_TOKEN}")
@@ -723,6 +724,12 @@ function github_status_write()
     --location \
     "${GITHUB_API_URL}/repos/${GITHUB_REPO}/statuses/${GITHUB_SHA}" \
     > /dev/null
+
+  retval=$?
+  if [[ ${retval} -gt 0 ]]; then
+    echo "githubstatus-report: Failed to write status. Maybe the credential 
does not have write access to repo:status."
+  fi
+  return ${retval}
 }
 
 ## @description  Print out the finished details to the Github PR

Reply via email to