I have a DevOps pipeline that is tasked with updating a file, and committing it back to a protected branch in Github. Checking out from the repo works just fine. I thought I had the right permission setup, but it doesn't work.
I have allowed azure-pipelines the permissions here:
I have specified the following to preserve the authentication from the original checkout here:
steps:
- checkout: self
persistCredentials: true
- task: Bash@3
inputs:
targetType: inline
script: |
git checkout integration
Then after the changes I make, I want to push back to the integration branch like this:
- 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
This returns the following output though and it doesn't push it back to the integration
branch:
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'