Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,311
Community Members
 
Community Events
184
Community Groups

Can't use Workspace Access Token to create a branch subject to branch permissions

I have a script that creates branches in Bitbucket in numerous repos.  Until now I've been using a dedicated Bitbucket User to do this.  I recently switched to using the new Workspace Access Token feature.  This worked until I tried to create a branch in a repo with Branch Permissions that limit write access to certain branch types to a single group (which that dedicated user I'd been using previously has been in).  

Using the Access Token, which has the "repository:write" scope, the push to create the new branch fails with `remote: Permission denied to create branch`.  I believe it's due to the branch permission.  Should this work?  Is there a way to give the Auth Token user permission here?

2 answers

I encountered the very same issue. I'm trying to push changes to a repository using a workspace access token, but I'm blocked by the branch restrictions. Those branch restrictions are required for the normal operations done by the developers, the script is required to bypass those.

I tried to get this working using the access tokens, but failed so far. I tried adding the access token to the branch restrictions as exception, both by the user interface of bitbucket and by the API of bitbucket. Both methods failed.

Just did some targeted testing.  A branch permission restricting edit will prevent both creating a branch matching the restriction, as well as pushing changes.  How can an Access Token be used in this case?  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events