Hello, we have branch permissions on a repository, and an access token used by jenkins for pushing some changes on it.
The access token has repository:write premission, but jenkins receive always access denied error.
Is there a way to set permissions for access token on branch permissions or some other solution?
Thanks
Hi Michele,
Saxea _Flowie_ is right that this is a limitation, access tokens cannot be added to branch restrictions at the moment. I just wanted to add that the limitation exists for OAuth access tokens as well.
If you have a branch restriction that limits who can push to a certain branch, then you'll need to authenticate with a user who is allowed to push to that branch in the branch restriction. This could be either HTTPS credentials of the user (Bitbucket username and API token) or with SSH keys associated with the user.
Please feel free to reach out if you have any questions.
Kind regards,
Theodora
Hi @Michele Virgilio ,
This is a known limitation and is reported in BCLOUD-22400.
I don't think this limitation applies to OAuth tokens, so you could have you build do the whole OAuth dance, get the token and push as described here.
Another option is to just use SSH to connect to the repo.
Alternatively, Flowie, our addon has a Jenkins integration, which can send data to Jenkins when triggering the build. You could configure it in a way that Flowie generates and sends a Bitbucket valid token to Jenkins to be able to push the changes, so you don't have to do all the auth work above. You'll need assistance from our support to configure it in this way - you can reach us at support@flowie.app.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.