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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can we allow pipeline to commit directly to master through permissions?

I've seen a question on this before (https://community.atlassian.com/t5/Bitbucket-questions/bitbucket-pipeline-user-permissions-to-write-to-master/qaq-p/1177712) but didn't see an answer that helped.

 

We are trying to use a pipeline to compile our react code and then commit/push it back into master, the only issue is we don't allow anyone to commit directly to master so this also prevents the bitbucket-pipelines user from committing directly to master. 

In this case we do want the bitbucket-pipelines user to be the ONLY one that can commit directly to master. As of right now we are committing to a new branch and then manually making a PR then approvals have to be done with multiple people then we can merge it into master.

Any fixes/ ideas would be great, Thanks!

1 answer

1 accepted

0 votes
Answer accepted

Take a look at this approach :)

Yeah we did pretty much this, we had to make a bot account and then use ssh. Thanks!

Like Radek Antoniuk likes this

@Clayton Bailey Could you describe in detail what you did?

I am trying to follow the instructions from support.atlassian.com/bitbucket-cloud/docs/push-back-to-your-repository/ (section "SSH Key pair managed with variables") where I:

  • Have made a new BitBucket-account for "the bot"
  • Have created an SSH-key for this account, and added the public part into BitBucket (personal settings for that user)
  • base64-version of the private key is added as repository-variable
  • In pipelines I ensure that the private-key exists correctly here: "

    ~/.ssh/id_rsa"

Results

  1. If I use SSH-version for "git origin", I get "Permission denied (publickey)".
  2. If I don't I get "bitbucket-pipelines" as author (default).
  3. If I use "git config user.name / git config user.email" to point to "the bot"-account, it looks great in the git-log, but it fails "branch-permissions". 

Turned out that my generated key had a password, created new key without password, and it worked great with SSH-mode.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

464 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you