Different author commit and pipeline
Asked by Erwin Augustijn:

Hi,  

I've worked on a specific repository and I've committed in there and when looking in Bitbucket the name of the author of the commits is mine.  

Nevertheless, the automatically triggered pipeline is showing that my colleague has started the pipeline, whilst this is an automatic process at which in other repositories the author of the commit is also the person who's linked to the pipeline.  
So a strange thing seems to be happening with this specific repository.  

I've checked my settings in SourceTree, but I'm nowhere using the name and/or email of my coworker. Also the repository doesn't contain any credentials in the .git directory which aren't mine and the settings of the repository are equal to others where everything goes fine. So I haven't a clue why this coworkers account is being linked to a pipeline which is triggered due to my branch with my commits.  

Do you have any clue?


Answers:
author: Theodora Boudale
body: Hi Erwin,

When you say that the pipeline is showing that your colleague has started it, do you mean that you see their user in the Pipelines page of the repo, for the associated build, like in the screenshot below?

![Screenshot 2021-02-03 at 13.11.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/128604i5481C0CAD1ED29B5/image-size/large?v=v2&px=999 "Screenshot 2021-02-03 at 13.11.14.png")

<br />

If so, the user that shows there is not the author of the commit that triggered the pipeline, but the authenticated Bitbucket user that pushed this commit.

Did you create this commit locally in your machine and then pushed it to Bitbucket? If so, then it sounds like you are authenticating with you colleague's credentials when pushing to this repo.

* Could you please check the accounts in SourceTree and see if your colleague's Bitbucket account is added there as well?
* Could you please check the remote URL of your local clone of this repo? Is it an HTTPS or an SSH one? If it is HTTPS, does it include your colleague's Bitbucket username in it?

Kind regards,  
Theodora

comments: author: Erwin Augustijn
body: Hi Theodora,  

Thanks for the answer, unfortunately it didn't help me yet.  
I do indeed create my commits locally on my machine and then push them to Bitbucket.
> Could you please check the accounts in SourceTree and see if your colleague's Bitbucket account is added there as well?

In Sourcetree I've checked my accounts under Tools \> Options \> Authentication.  
Here I do have 3 accounts:

* eaibizz@bitbucket.org
* eaibizz@sourcetree-rest:<https://bitbucket.org>
* sourcetree-rest:<https://bitbucket.org> (Default account)

In the specific repository which goes wrong, I do see 2 origins ("origin" and "composer") with the data mentioned in the image below (below the quote).  

So I don't see any reference to my colleagues login details.  

I even checked the config file in the .git folder, but I don't see any credentials there either.
> Could you please check the remote URL of your local clone of this repo? Is it an HTTPS or an SSH one? If it is HTTPS, does it include your colleague's Bitbucket username in it?

![1612358651_SourceTree_6cFJMkMcqz.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/128616i405A575AA3A0823D/image-size/large?v=v2&px=999 "1612358651_SourceTree_6cFJMkMcqz.jpg")  

Here are my commits:  
![bitbucketcommits.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/128618i74615AAB78393F19/image-size/large?v=v2&px=999 "bitbucketcommits.jpg")  
And here are some of the pipelines which were triggered by those commits:  
![bitbucketpipelines.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/128619i41A13D8057F88EE0/image-size/large?v=v2&px=999 "bitbucketpipelines.jpg")  
You can see that MJ is mentioned here, while I have made the commit.  

Can I be authenticated differently in SourceTree for committing and pushing?  
![sourcetreecommitter.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/128620i7C1F635CB74D59EA/image-size/large?v=v2&px=999 "sourcetreecommitter.jpg")


author: Theodora Boudale
body: Hi Erwin,

Thank you very much for the info, and apologies for the delay, I missed the notification for your reply.
> Can I be authenticated differently in SourceTree for committing and pushing?

The author of a commit and authentication are two different things.

The author is determined by what email you specify in your local Git configuration and it doesn't have anything to do with authentication. For example, if you use in your local Git configuration an email that is not associated with your Bitbucket Cloud account, then this commit will not be mapped to your user in the **Commits** page of the repo in Bitbucket UI.

When you push to a repo, we don't look at the author of the commits (you can push commits with author other than your user). You get authenticated either by HTTPS (Bitbucket username + password) or SSH (with SSH keys you have set up for your Bitbucket Cloud account), so we can check if your Bitbucket user has permissions to push to this specific repo.

++For the original issue/question:++

- You mentioned that these are automatically triggered pipelines. Could you please check and confirm with me that they are not re-runs of previous builds?

If your colleague re-ran a build that was previously automatically triggered by you, then it would show their name.

- I see in the screenshot of SourceTree remote details that the repo has an SSH URL.

We can double check if the SSH keys used in SourceTree are indeed linked to your Bitbucket account.

* Are you using SourceTree for Windows with Pageant, or SourceTree for Mac
* Do you have multiple SSH keys in the machine you are pushing from?
* Do you have a config file in the .ssh folder of your local user, and if so, is there any configuration there specifically for bitbucket.org?
* Can you share the public SSH key that you use for SourceTree, so I can check in our system if it is indeed linked to your account?

Kind regards,  
Theodora


author: Erwin Augustijn
body: Hi Theodora,  

I'm using SourceTree for Windows with Pageant indeed.  
I do have one ssh key which is linked to my Windows User account:

```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVW91Vpu3BXfDeY48MWlYMj+PgGrCT/LPTUyulFS5KI5vr3ZZsa68XtYkeZVUAf/WQN+F/V208g7lE2fLafzV33Ih04yLbrEIiRuWjN9sHldwjhxJAsh1hM+5YNxawZ3ZCJYeWBUqmeqKyqTWHPzqZFFJWLIy2VWSYqzuqF1zytRDV7lGu41R2dGvLLE283LSsgZNzsZxjo2SkUMe4PIZAiwNM/D+cjckshzc2zMsmA4wM97OBPckN69aJNV19pcXtQPvGM/InbDYkQdp0qan7UPO2gMqoMArmqve6aiXyB3o0OUoGIYh22QWn+lvio0sZJM8lJHep2nCCM4jEZXPp
```

And one ssh key which is used by Docker (and autogenerated):

```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLcEHPHV77MoHDhgrjC4TpQ9/wqPAA0Tx2wG+HlSkAr9jxZAc+NXh6CnPhBCiigrglAJrvGIn6t8RNn5+Npn2NpsX8D1WY5cs/qkfgb3pBxBO6Gy5MjGCPg+7EOnEzrCAJwsMFbWlo2vgfdA/K5d92pgZITAW1og+Js9oXublo+2EfwsvoLs4qDQdPKRPd228he9pN5t9EygiqF+ZTwSPuECyTZTJQZVwNqXfGHslB/2cCVqP7lBkF27h0/BlHoi/YAbkTomnQmgMU9xrjOiSThvRwVtw/8l51igz9LHAqqp1ymffza1ESj3kB5wAGp0tUhHWh0vVtPqi3W6V04kK1 root@51a3747221b5
```

My .gitconfig file in my Windows User account:

```
[difftool "sourcetree"]
cmd = '' \"$LOCAL\" \"$REMOTE\"
[user]
name = Erwin LASTNAME
email = erwin@domain.ext
[mergetool "sourcetree"]
cmd = "'' "
trustExitCode = true

```

My .gitconfig file in my Docker environment:

```
[user]
name = Erwin LASTNAME
email = erwin@domain.ext
[core]
autocrlf = false
[pull]
rebase = false
[color]
ui = true
status = auto

[color "status"]
added = green
changed = blue
untracked = magenta
deleted = red??
```


author: ktomk
body: IIRC this can happen when I share branches with colleagues and there is an ancestor that is shared and then I push it or my colleague pushed it, I can see pipelines created by me that are of my colleague and vice-versa.

Technically I can always push a commit of my colleague, still then I have triggered the pipeline but the commit is not "mine". So actually unless you need this more controlled, I'd say this is totally possible.

Are you using wildcard-patterns in the bitbucket-pipelines.yml to trigger on branches or tags?

(Also I assume you're using Git, let me know if not).

comments: author: Erwin Augustijn
body: Hi ktomk,

<br />

Thanks for answering.  
No, we're using defines branches in this format:

```
pipelines:
   default:
     - step: *validate-project
   branches:
     test:
       - step: *validate-project
       - step: *compile-files
       - step:
           <<: *publish
           name: Publish to test
           deployment: Test
      ...
```

The biggest problem we're facing is:

* I don't receive email when my pipelines (for that specific package) fails
* My colleague receives email from pipelines which are triggered by my code

Luckily I'm still the commit author, so it's not that I'm commiting as him, but I still think it's weird that I haven't found the explanation yet why this is happening.


Tags: author

bitbucket-pipelines

commit