if re_match "${GIT_REPOSITORY:-}" '^https://github.com/'; then
_auth="x-access-token:$GIT_TOKEN"
else
_auth="oauth2:$GIT_TOKEN"
fi
if re_match "${GIT_REPOSITORY:-}" '^https://github.com/'; then
_auth="x-access-token:$GIT_TOKEN"
elif re_match "${GIT_REPOSITORY:-}" '^https://bitbucket.org/'; then
_auth="x-token-auth:$GIT_TOKEN"
else
_auth="oauth2:$GIT_TOKEN"
fi
Bitbucket uses
x-token-auth
instead ofx-access-token
in the git URL (https://support.atlassian.com/bitbucket-cloud/docs/using-access-tokens/). The following change should work, but I am unable to test it: