Requirement is to merge develop branch to master branch using pipeline so that it can be scheduled and merge will happen without any fail. I am trying to use 'Command Line Script' task in an Azure Pipeline with windows agent to perform the operation.
I have tested above workflow in local machine and it is working fine. But, the same is failing in pipeline. Pipeline is set to run against the 'develop' branch as source. So, the code will be checkout to a folder named 's' in the initial step. Below are the commands I have tried.
cd s
git checkout main
git merge origin/develop
git push origin main
The error logs are as below:
Previous HEAD position was cb71633 Updated test1.yml
Switched to a new branch 'main'
Branch 'main' set up to track remote branch 'main' from 'origin'.
Updating f1cf63a..cb71633
Fast-forward
test1.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
fatal: Cannot prompt because user interactivity has been disabled.
fatal: Cannot prompt because user interactivity has been disabled.
fatal: could not read Password for 'https://<<user>>@dev.azure.com/<<Org>>/<<Project>>/_git/merge-test-repo': terminal prompts disabled
##[error]Cmd.exe exited with code '128'.
Can you please help me with the above script?
I would also like to know how can we check the latest status of a build pipeline running from develop branch to confirm that it is ready for a merge. So, the expected flow in the script is as below:
- check if the latest build status of pipeline from develop is success. if yes proceed.
- checkout master branch
- merge source branch (develop) to master. Fail pipeline if there are conflicts.
- push the merge commit to master branch.
Please guide me with the script creation for above. Thanks in advance.