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

Commit

Permalink
update (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsfaMumtaz authored Oct 30, 2023
1 parent 5eeba0c commit a71e556
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit a71e556

Please sign in to comment.