I’m trying to write a pipeline in Azure DevOps that can look at some code I write in VSCode and automatically add., commit, and push it without me every having to do anything in the console. Here is the code I have so far
trigger:
- main
pool: Agent Pool
steps:
- script: |
git checkout azure-pipelines
git pull origin main –rebase
git add .
git commit -m “New Commit”
git push -f origin main
displayName: ‘Push Code’
I was able to simplify it down to this but the problem has remained constant. No matter what I do, it will not commit anything I have in VSCode. I had a URL origin check at one point but that only seemed to confuse the program. So I guess I have two questions on this
- How can I check what URL my Azure Repo is in VSCode?
- Is what I am trying to do even possible with a pipeline and, if so, how can I do it better than this?
jrmj4495 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1