Azure Pipelines: I am getting fatal: could not read Username for 'https://github.com': terminal prompts disabled

前端 未结 4 1177
一向
一向 2021-01-02 08:02

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

4条回答
  •  孤街浪徒
    2021-01-02 08:15

    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

提交回复
热议问题