You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@yetus.apache.org by aw...@apache.org on 2020/10/05 13:31:24 UTC

[yetus] branch main updated: YETUS-1014. GitHub/GitLab: fill in project name from repo (#146)

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

aw 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 8e1a363  YETUS-1014. GitHub/GitLab: fill in project name from repo (#146)
8e1a363 is described below

commit 8e1a36314a091c5496d9130553a7d27107806d8d
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Mon Oct 5 06:31:02 2020 -0700

    YETUS-1014. GitHub/GitLab: fill in project name from repo (#146)
---
 precommit/src/main/shell/test-patch.d/github.sh | 3 +++
 precommit/src/main/shell/test-patch.d/gitlab.sh | 4 ++++
 2 files 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 32ccb29..9770980 100755
--- a/precommit/src/main/shell/test-patch.d/github.sh
+++ b/precommit/src/main/shell/test-patch.d/github.sh
@@ -198,6 +198,9 @@ function github_initialize
     PATCH_BRANCH_DEFAULT=$("${GREP}" default_branch "${PATCH_DIR}/github-repo.json" | head -1 | cut -d\" -f4)
   fi
 
+  if [[ "${PROJECT_NAME}" == "unknown" ]]; then
+    PROJECT_NAME=${GITHUB_REPO##*/}
+  fi
 }
 
 ## @description based upon a github PR, attempt to link back to JIRA
diff --git a/precommit/src/main/shell/test-patch.d/gitlab.sh b/precommit/src/main/shell/test-patch.d/gitlab.sh
index a845c27..2736640 100755
--- a/precommit/src/main/shell/test-patch.d/gitlab.sh
+++ b/precommit/src/main/shell/test-patch.d/gitlab.sh
@@ -88,6 +88,10 @@ function gitlab_initialize
 
   # convert the repo into a URL encoded one.  Need this for lots of things.
   GITLAB_REPO_ENC=${GITLAB_REPO/\//%2F}
+
+  if [[ "${PROJECT_NAME}" == "unknown" ]]; then
+    PROJECT_NAME=${GITLAB_REPO##*/}
+  fi
 }
 
 ## @description given a URL, break it up into gitlab plugin globals