Skip to content

Commit

Permalink
Check npm exit code
Browse files Browse the repository at this point in the history
Check that npm did not error when attempting to install the package.
  • Loading branch information
martincostello committed Jun 22, 2023
1 parent 04b0f5b commit b4c12eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/update-dotnet-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ jobs:
$currentVersion = (Get-Content .\package.json | ConvertFrom-Json).dependencies.$package.TrimStart('^')
if ($currentVersion -ne $newVersion) {
npm install "${package}@${newVersion}"
$packageVersion = "${package}@${newVersion}"
npm install $packageVersion
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to install $packageVersion."
exit $LASTEXITCODE
}
Pop-Location
$commitMessageLines = @(
Expand Down

0 comments on commit b4c12eb

Please sign in to comment.