WoozyMasta / archimate-ci-image

Archi container image for use in continuous integration pipelines
https://woozymasta.github.io/archimate-ci-image-example/?view=6213
MIT License
40 stars 23 forks source link

Bitbucket uses x-token-auth instead of x-access-token #14

Open 5-tom opened 1 year ago

5-tom commented 1 year ago

Bitbucket uses x-token-auth instead of x-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:

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