1111
1212if ($env: PublishChanges -eq $False )
1313{
14- Write-Host " Not publishing changes per the run parameter!" - ForegroundColor Yellow
14+ Write-Host " Not publishing changes per the run parameter!"
1515 return ;
1616}
1717
18- Write-Host " `n Get status:" - ForegroundColor Green
19- git status | Write-Host - ForegroundColor Yellow
18+ Write-Host " `n git status:"
19+ git status | Write-Host
2020
21- Write-Host " `n Stash the update metadata files.....`n Running: git stash" - ForegroundColor Green
22- git stash | Write-Host - ForegroundColor Yellow
21+ Write-Host " `n Stash the update metadata files.....`n Running: git stash"
22+ git stash | Write-Host
2323
24- Write-Host " `n Fetching latest master branch to ensure we are up to date..." - ForegroundColor Green
25- git fetch origin master | Write-Host - ForegroundColor Yellow
24+ Write-Host " `n Fetching latest master branch to ensure we are up to date..."
25+ git fetch origin master | Write-Host
2626# checkout master to move from detached HEAD mode
27- git switch master | Write-Host - ForegroundColor Yellow
27+ git switch master | Write-Host
2828
29- Write-Host " `n Get status:" - ForegroundColor Green
30- git status | Write-Host - ForegroundColor Yellow
29+ Write-Host " `n git status:"
30+ git status | Write-Host
3131
32- Write-Host " `n Apply stashed metadata files...`n Running: git stash pop" - ForegroundColor Green
33- git stash pop | Write-Host - ForegroundColor Yellow
32+ Write-Host " `n Apply stashed metadata files...`n Running: git stash pop"
33+ git stash pop | Write-Host
3434
35- Write-Host " `n Get status:" - ForegroundColor Green
36- git status | Write-Host - ForegroundColor Yellow
35+ Write-Host " `n git status:"
36+ git status | Write-Host
3737
3838if ($env: CreatePR -eq $True )
3939{
40- Write-Host " `n Create branch: $env: BUILD_BUILDID /updateOpenAPI" - ForegroundColor Green
41- git checkout - B $env: BUILD_BUILDID / updateOpenAPI | Write-Host - ForegroundColor Yellow
40+ Write-Host " `n Create branch: $env: BUILD_BUILDID /updateOpenAPI"
41+ git checkout - B $env: BUILD_BUILDID / updateOpenAPI | Write-Host
4242}
4343
44- Write-Host " `n Staging clean $env: EndpointVersion metadata files....." - ForegroundColor Green
45- git add . | Write-Host - ForegroundColor Yellow
44+ Write-Host " `n Staging clean $env: EndpointVersion metadata files.....`n Running: git add . "
45+ git add . | Write-Host
4646
47- Write-Host " `n Get status:" - ForegroundColor Green
48- git status | Write-Host - ForegroundColor Yellow
47+ Write-Host " `n git status:"
48+ git status | Write-Host
4949
50- Write-Host " `n Attempting to commit clean $env: EndpointVersion metadata files....." - ForegroundColor Green
50+ Write-Host " `n Attempting to commit clean $env: EndpointVersion metadata files....."
5151
5252if ($env: BUILD_REASON -eq ' Manual' ) # Skip CI if manually running this pipeline.
5353{
54- git commit - m " Update clean metadata file with $env: BUILD_BUILDID [skip ci]" | Write-Host - ForegroundColor Yellow
54+ git commit - m " Update clean metadata file with $env: BUILD_BUILDID [skip ci]" | Write-Host
5555}
5656else
5757{
58- git commit - m " Update clean metadata file with $env: BUILD_BUILDID " | Write-Host - ForegroundColor Yellow
58+ git commit - m " Update clean metadata file with $env: BUILD_BUILDID " | Write-Host
5959}
6060
61- Write-Host " `n Get status:" - ForegroundColor Green
62- git status | Write-Host - ForegroundColor Yellow
61+ Write-Host " `n git status:"
62+ git status | Write-Host
6363
6464if ($env: CreatePR -eq $True )
6565{
66- Write-Host " `n Pushing branch for PR creation" - ForegroundColor Green
66+ Write-Host " `n Pushing branch for PR creation"
6767
68- Write-Host " `n git push --set-upstream origin $env: BUILD_BUILDID /updateOpenAPI:" - ForegroundColor Green
69- git push -- set-upstream origin $env: BUILD_BUILDID / updateOpenAPI | Write-Host - ForegroundColor Yellow
68+ Write-Host " `n git push --set-upstream origin $env: BUILD_BUILDID /updateOpenAPI:"
69+ git push -- set-upstream origin $env: BUILD_BUILDID / updateOpenAPI | Write-Host
7070}
7171else # original behavior: push to master
7272{
73- Write-Host " `n Running: git pull origin master --rebase..." - ForegroundColor Green
73+ Write-Host " `n Running: git pull origin master --rebase..."
7474 # sync branch before pushing
7575 # this is especially important while running v1 and beta in parallel
7676 # and one process goes out of sync because of the other's check-in
77- git pull origin master -- rebase | Write-Host - ForegroundColor Yellow
77+ git pull origin master -- rebase | Write-Host
7878
79- Write-Host " `n Running: git push --set-upstream origin master ..." - ForegroundColor Green
80- git push -- set-upstream origin master | Write-Host - ForegroundColor Yellow
79+ Write-Host " `n Running: git push --set-upstream origin master ..."
80+ git push -- set-upstream origin master | Write-Host
8181}
0 commit comments