diff --git a/stakater-create-environment/helm/templates/clustertask.yaml b/stakater-create-environment/helm/templates/clustertask.yaml index 1fe17bc..77dbc55 100644 --- a/stakater-create-environment/helm/templates/clustertask.yaml +++ b/stakater-create-environment/helm/templates/clustertask.yaml @@ -80,21 +80,21 @@ spec: echo "$FILE exists." GIT_TOKEN=`cat $FILE` - if [[ $params.GIT_URL == *github.com* ]]; then + if [[ $(params.GIT_URL) == *github.com* ]]; then echo "This is a GitHub repository." PR_FIRST_COMMIT_HASH=`curl --header "Authorization: token $GIT_TOKEN" \ $(params.PULL_REQUEST_COMMITS_API) | jq -r 'first.sha' | head -c 8` # Check if the URL contains "gitlab.com" - elif [[ $params.GIT_URL == *gitlab.com* ]]; then + elif [[ $(params.GIT_URL) == *gitlab.com* ]]; then echo "This is a GitLab repository." PR_FIRST_COMMIT_HASH=`curl --header "PRIVATE-TOKEN: $GIT_TOKEN" \ $(params.PULL_REQUEST_COMMITS_API) | jq -r '.sha // .head?.sha' | head -c 8` fi else - if [[ $params.GIT_URL == *github.com* ]]; then + if [[ $(params.GIT_URL) == *github.com* ]]; then PR_FIRST_COMMIT_HASH=`curl $(params.PULL_REQUEST_COMMITS_API) | jq -r 'first.sha' | head -c 8` - elif [[ $repo_url == *gitlab.com* ]]; then + elif [[ $(params.GIT_URL) == *gitlab.com* ]]; then PR_FIRST_COMMIT_HASH=`curl $(params.PULL_REQUEST_COMMITS_API) | jq -r '.sha // .head?.sha' | head -c 8` fi fi