You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I want to give the bitbucket-pipelines user permissions to write to master. It should be allowed to push commits and tags. But, it's not possible to select the bitbucket-pipelines user in the Write access dropdown under Settings|Workflow|Branch Permissions even though the user exists and can write if I give Everybody permissions.
* e2e40b8 (HEAD -> master, tag: v0.1.2, origin/master, origin/HEAD) v0.1.2 bitbucket-pipelines, 9 minutes ago
* 66fc994 Merged in STOR-314-demo-branch (pull request #29) Anders Janmyr, 75 minutes ago
| * ea873c7 STOR-
How can I give permissions to the bitbucket-pipelines user while denying everyone else?
that is not necessary. Bitbucket Pipelines is preconfigured to push back to Git by default. There no need for further configuration :-)
Take a look at this page in the documentation.
I seem to be having the same issue that Anders described. Merges to master were successfully committing version # updates as part of the repository bitbucket-pipeline. I restricted write access about a week ago, and now the automagic commits are rejected. I didn't change any other build settings or scripts in between, just the branch permissions.
I would like
As far as I have been able to find, I can only have one or the other of these; currently I cannot get both. It seemed logical to me (and apparently also to Anders) to simply grant write access to the user 'bitbucket-pipelines' in order to achieve desired item #2 above. But this user doesn't appear in the selection auto-fill and isn't allowed to be manually edited, so I'm stuck.
I have the exact same problem. I am looking for a precise solution for how to achieve this:
This sounds like a common pattern. Atlassian, please give us a solution for this.
Seriously Atlassian, this is something so technical fundamental and important to setup proper versioning via a technical user and until today I cannot find some resourceful documentation about how to handle this.
I spent now about 3 hours without any form of progress and I wished I could write you a bill for those hours or obtain any kind of compensation, because I will talk about this with my therapist.
Absolutely not understandable fromm the the perspective of prices you offer for your "service".
I could have simply played Elden Ring or any Dark Souls game and would have had a more rewarded feeling in those hours.
There are dozens of stack overflow articles asking the same questions, plenty of people write here that they have the same issue since 2020 and you did not get the documentation done in all this time. Great example of customer support ...
Pls take the hate I am spilling right now as a reflection of the quality of your documentation and I hope I can make other people feeling the same way somehow feeling understood/heard.
The steps for allowing to push back commit from pipeline is well documented here.
If you do setup Branch permissions on master or any branch and want to push back changes via pipeline, then you will need to setup using OAuth/ SSH Keys as described in the second half of the article.
Have tried this to verify it works :)
I have tried it, and it only works if you enable write permissions to the branch from an account and then setup the remote in the pipelines using that account oauth/keys.
What all these users above (including me) want is to not make a "bot" account or grant any user write permissions, and still have a way to write from bitbucket pipelines.
Tried the recommended Oauth2 solution. Was able to get the auth token, and set the git url. However subsequently pushing still did not go through.
remote: Permission denied to update branch master.
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://x-token-auth:firstname.lastname@example.org/myname/myrepo'
@Rajat Goyal any idea what is wrong.
Discovered the Oauth token has an associated user whose name is $BITBUCKET_REPO_OWNER. The Bitbucket API can be used to get the current user name in the pipeline. The API can also be used to give this user write access on any branch, i.e. master. If so, the pipeline can manage the permissions of this user and thereby allow permit the push back to repo on master. It would be nice if this user was available for selection in the Edit Branch Permissions Modal.