如何使用 bitbucket-pipeline.yml 文件从功能分支合并到主分支?

how to merge from feature branch to the master branch using bitbucket-pipeline.yml file?

使用功能分支工作,我如何配置我的 bitbucket-pipeline.yml 文件,使更改自动合并到 master 分支?

这就是我将分支合并到 master 所做的工作

#fetch from all branches and mock a user to perform the merge
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
  \ && git config user.email "git@example.com"
  \ && git config user.name "git"
- git fetch origin && git checkout origin/master
- git merge $BITBUCKET_BRANCH

最后,如果你想提交合并,你应该在脚本末尾添加一个 git push 命令,可能使用存储库的真实帐户。

编辑

上述解决方案似乎仅当用户是存储库的所有者时才有效。
尝试使用 depth option for the pipeline configuration as stated here,克隆完整的存储库。