From d85d1e2829713e46f1d51953681a68e69ca69f63 Mon Sep 17 00:00:00 2001 From: Deepak Joshi <166969196+deepakjoshi-ekline@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:31:50 +0530 Subject: [PATCH] feat: Compute Quality Scores on Nom-PR runs Ticket Link : [Link](https://ekline.atlassian.net/jira/software/projects/EK/boards/1?assignee=712020%3Abf39a77b-882a-43e0-98b9-696d31875731&selectedIssue=EK-666) GitLab Test : [Link](https://gitlab.com/djoshi8/gitlabtesting/-/jobs/8726223971) BitBucket Test : [Link](https://bitbucket.org/ekline-io/test/pipelines/results/192) GitHub Test : [Link](https://github.com/ekline-io/ekline-github-action-private/actions/runs/12484587026/job/34842185812) --- entrypoint.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 72ac529..c704dd6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -83,6 +83,22 @@ else exit 1 fi +if [ -z "$pull_request_id" ]; then + if [ "$ci_platform" = "github" ]; then + resolved_branch="$(echo "$GITHUB_REF" | sed 's|refs/heads/||')" + base_branch="$resolved_branch" + head_branch="$resolved_branch" + elif [ "$ci_platform" = "gitlab" ]; then + resolved_branch="$CI_COMMIT_BRANCH" + base_branch="$resolved_branch" + head_branch="$resolved_branch" + elif [ "$ci_platform" = "bitbucket" ]; then + resolved_branch="$BITBUCKET_BRANCH" + base_branch="$resolved_branch" + head_branch="$resolved_branch" + fi +fi + if [ -n "${input_workspace}" ] ; then cd "${input_workspace}/${INPUT_WORKDIR}" || { echo "Failed to get ${input_workspace}/${INPUT_WORKDIR}"; exit 1; } git config --global --add safe.directory "${input_workspace}" || exit 1