File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ kind: step-type
22version : ' 1.0'
33metadata :
44 name : git-commit
5- version : 0.1.4
5+ version : 0.2.0
66 isPublic : true
77 description : Commit and push changes to repository
88 icon :
@@ -155,6 +155,9 @@ spec:
155155 - export GIT_ACCESS_TOKEN_USER=$(codefresh get context $GIT_INTEGRATION_NAME --decrypt --prepare -o yaml | yq -r -c .spec.data.auth.username)
156156 - export PRIVATE_KEY=$(codefresh get context $GIT_INTEGRATION_NAME --decrypt --prepare -o yaml | yq .spec.data.auth.sshPrivateKey)
157157 - echo PRIVATE_KEY=$PRIVATE_KEY >> /meta/env_vars_to_export
158+ # For Bitbucket Cloud integration with API Token, replace username by 'x-bitbucket-api-token-auth'
159+ - export GIT_INTEGRATION_TYPE=$(codefresh get context "$GIT_INTEGRATION_NAME" --decrypt --prepare -o yaml | yq -r -c .spec.type)
160+ - if [ "$GIT_INTEGRATION_TYPE" = "git.bitbucket" ] && [ "${GIT_ACCESS_TOKEN#ATAT}" != "$GIT_ACCESS_TOKEN" ]; then export GIT_ACCESS_TOKEN_USER="x-bitbucket-api-token-auth"; fi
158161 # If the git integration does not include the auth username, then default to the git_user_name argument
159162 - if [ "$GIT_ACCESS_TOKEN_USER" = "null" ]; then export GIT_ACCESS_TOKEN_USER=$GIT_USER_NAME; fi
160163 - echo GIT_ACCESS_TOKEN_USER=$GIT_ACCESS_TOKEN_USER >> /meta/env_vars_to_export
You can’t perform that action at this time.
0 commit comments