[Environment: Team Services, GIT, hosted build agent]
I'd like to create a Team Services build definition that is able to do the following:
Executing a script to generate some new files based on existing files in the repo
Commit/push those generated files back to repo
I can do #1 with no problem. But I'm not sure how I can do #2.
I discovered I was actually able to run git.exe from inside a build job. But I'm not sure how I can pass the credential to git. Based on the build logs, it's failing because it's trying to get the username from stdin.
I tried adding a step in the build definition with something like "git config --global user.name xxxx" but it still didn't help.
Is this a supported scenario at all? Any suggestions?
Thanks!
Edit
I tried the following approach in my build script:
git -c http.extraheader="AUTHORIZATION: bearer %SYSTEM_ACCESSTOKEN%" pull ...
It seemed to work for commands like pull, etc. But when I was trying to push the changes, I got the below error:
fatal: unable to access 'https://example.visualstudio.com/SampleTeam/_git/SampleRepo/': SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
Thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…