I have powershell task configured in azure build pipelines to merge changes from dev into master of my github public repo and push changes to master. I am getting
Not the exact same situation you have but this was the only post that came close to my similar situation so I thought it's worth adding my solution here. I had this error in a hosted Ubuntu Azure Pipeline, running a shell command task to checkout, edit and push to git.
I got the error when attempting to push with command:
git push
I fixed it by changing the command to:
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push
$(System.AccessToken) is a predefined variable in the Azure Pipelines: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml