Skip to content

Commit a524399

Browse files
committed
Fix CI pipeline
fix git commands that would throw and cause the CI to fail
1 parent f3de4e7 commit a524399

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

ConfluencePS.build.ps1

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,32 +468,38 @@ task PublishToGallery {
468468

469469
# Synopsis: Update the HEAD of this git repo in the homepage repository
470470
task UpdateHomepage {
471+
$originalErrorActionPreference = $ErrorActionPreference
471472
try {
473+
$ErrorActionPreference = 'Continue'
472474
# Get the repo of the homepage
473-
exec { git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>$null }
475+
git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>$null
474476
Write-Host "Cloned"
475477
Set-Location "AtlassianPS.github.io/"
476478

477479
# Update all submodules
478-
exec { git submodule foreach git pull origin master 2>$null }
479-
Write-Host "Fetched"
480+
# git submodule foreach git pull origin master 2>$null
481+
# Write-Host "Fetched"
480482

481483
# Check if this repo was changed
482-
$status = exec { git status -s 2>$null }
484+
$status = git status -s 2>$null
485+
Write-Host $status
483486
if ($status -contains " M modules/$PROJECT_NAME") {
484487
Write-Host "Has changes"
485488
# Update the repo in the homepage repo
486-
exec { git add modules/$PROJECT_NAME 2>$null }
489+
git add modules/$PROJECT_NAME 2>$null
487490
Write-Host "Added"
488-
exec { git commit -m "Update module $PROJECT_NAME" 2>$null }
491+
git commit -m "Update module $PROJECT_NAME" 2>$null
489492
Write-Host "Commited"
490-
exec { git push 2>$null }
493+
git push 2>$null
491494
Write-Host "Pushed"
492495
}
493496
}
494497
catch {
495498
throw $_
496499
}
500+
finally {
501+
$ErrorActionPreference = $originalErrorActionPreference
502+
}
497503
}
498504

499505
# Synopsis: Create a zip package file of the release

0 commit comments

Comments
 (0)