You can try adding a Command Line Script task to the agent job of the build pipeline, and then push the update to github via the git command.
The commands added in the task are as follows:
git clone https://github.com/XXX/XXX.git
git config --global user.name "XXX"
git checkout master
git add .
git commit -m "abc"
git push https://%gt%@github.com/xxx/xxx.git
Here is my sample:
Note:You need provide your github PAT in push url, like the example below:
git push https://{yourPAT}@github.com/xxx/yyy.git
To protect your PAT, you could use secure variable , such as gitHubPat, change variable type to secret.
Then you could add an Environment Variable, in my example: gt. Then set its value to $(gitHubPat).In command line task, you use double %% to get the value of environment variable "gt".
If you need to push the updates from your azure devops repo to github repo in real time, you can set in Build Triggers and check the Enable continuous integration option.So if your master branch changes, it will trigger ci build, your update will be pushed to github repo.
Hope this helps.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…