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

Commit

Permalink
Update create env task (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsfaMumtaz authored Oct 30, 2023
1 parent ab962c4 commit 376664e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stakater-create-environment/helm/templates/clustertask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ spec:
echo "$FILE exists."
GIT_TOKEN=`cat $FILE`
if [[ $repo_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 [[ $repo_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 [[ $repo_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
PR_FIRST_COMMIT_HASH=`curl $(params.PULL_REQUEST_COMMITS_API) | jq -r '.sha // .head?.sha' | head -c 8`
Expand Down

0 comments on commit 376664e

Please sign in to comment.