【发布时间】:2020-09-23 21:57:31
【问题描述】:
我有一个 DevOps 管道,其任务是更新文件并将其提交回 Github 中的受保护分支。从回购中签出工作正常。我以为我设置了正确的权限,但它不起作用。
我已在此处允许 azure-pipelines 权限:
我已指定以下内容以保留原始结帐的身份验证:
steps:
- checkout: self
persistCredentials: true
- task: Bash@3
inputs:
targetType: inline
script: |
git checkout integration
然后在我做出更改之后,我想像这样推回集成分支:
- task: Bash@3
inputs:
targetType: inline
script: |
cd ./Test/Test.UWP
git config --global user.email "test@test.com"
git status
cd ../..
git add .
git commit -m "Release $(versionNumber)"
git push origin integration
这会返回以下输出,但不会将其推回integration 分支:
remote: error: GH006: Protected branch update failed for refs/heads/integration.
remote: error: At least 1 approving review is required by reviewers with write access.
To https://github.com/test/test-app
! [remote rejected] integration -> integration (protected branch hook declined)
error: failed to push some refs to 'https://github.com/test/test-app'
【问题讨论】:
标签: git github azure-devops devops