There is an issue when building pull requests and the clone trait is present with shallow clone option.
Apparently you need some history in order to be able to do a merge.
We need to disable shallow clone when we know a merge will take place.
At the first look, this can be fixed in
I had identified the problem using bitbucket-branch-source-plugin but the should be visible on github-branch-source-plugin also..