Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Fix param #256

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stakater-create-environment/helm/templates/clustertask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading