From f4e8c13003a5e7bc2ca0e80e433636e729de20b5 Mon Sep 17 00:00:00 2001 From: Siddharth Khatsuriya Date: Tue, 14 Sep 2021 15:54:18 +0530 Subject: [PATCH] changing github sha to branch names --- entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index ad572dc..20b186a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,11 +15,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # ######################################################################## -env | grep ARGO +set -o xtrace + +if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]] +then + BRANCH_NAME=${GITHUB_REF} +else + BRANCH_NAME=${GITHUB_HEAD_REF} +fi WORKFLOW_NAME=`argo submit -v -o json --from wftmpl/${1} -n ${2} -l workflows.argoproj.io/workflow-template=${1} --argo-base-href '' \ -p ci-repository-url="git@github.com:${GITHUB_REPOSITORY}.git" \ - -p ci-commit-sha=${GITHUB_SHA} -p delay-destroy=${3} \ + -p ci-commit-sha=${BRANCH_NAME} -p delay-destroy=${3} \ -p addon-url="${4}" \ -p job-name=${5} \ -p splunk-version=${6} \