diff --git a/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 b/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 index 4d1c6a1a8..5ce83edaf 100644 --- a/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 +++ b/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 @@ -24,7 +24,7 @@ $body = ConvertTo-Json $annotation -Compress # Az CLI and Invoke-AzRestMethod both work in GitHub Actions, but Az throws various (inconsistent) errors in localhost. Invoke-AzRestMethod -Path "$ApplicationInsightsResourceId/Annotations?api-version=2015-05-01" -Method PUT -Payload $body -if (!$?) +if (-not $?) { exit 1 } diff --git a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 index 546b2fcac..b88a1518f 100644 --- a/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 +++ b/.github/actions/build-dotnet/Build-DotNetSolutionOrProject.ps1 @@ -73,7 +73,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object { if ($noErrors) { Write-Output "::error file=$file,line=$line,col=$column::$message" } } -if ($noErrors -and !$?) +if ($noErrors -and -not $?) { exit 1 } @@ -122,4 +122,3 @@ if ($expectedErrorCodes) Write-Output 'Verification complete, the solution or project only has the expected errors!' exit 0 } - diff --git a/.github/actions/publish-nuget/New-NuGetPackage.ps1 b/.github/actions/publish-nuget/New-NuGetPackage.ps1 index c84ff012e..c65b0b0df 100644 --- a/.github/actions/publish-nuget/New-NuGetPackage.ps1 +++ b/.github/actions/publish-nuget/New-NuGetPackage.ps1 @@ -64,7 +64,7 @@ function Get-ProjectProperty $shouldDownloadBaseLinePackages = ($EnablePackageValidation -And $PackageValidationBaselineVersion -And - !($Version -match '-(alpha|beta|preview|rc)[.-]') -And + -not ($Version -match '-(alpha|beta|preview|rc)[.-]') -And $Version.Split('.')[0] -le $PackageValidationBaselineVersion.Split('.')[0]) $projects = (Test-Path *.sln) ? (dotnet sln list | Select-Object -Skip 2 | Get-Item) : (Get-ChildItem *.csproj) diff --git a/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 b/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 index ec6ede103..5d86ba5d2 100644 --- a/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 +++ b/.github/actions/test-dotnet/Invoke-SolutionTests.ps1 @@ -208,9 +208,9 @@ foreach ($test in $tests) $processResult = StartProcessAndWaitForExit -FileName 'dotnet' -Arguments "test $($dotnetTestSwitches -join ' ')" -Timeout $TestProcessTimeout - if ($processResult.ExitCode -eq 0 -or (!$processResult.HasExited -and $processResult.HasTestRunSuccessfully)) + if ($processResult.ExitCode -eq 0 -or (-not $processResult.HasExited -and $processResult.HasTestRunSuccessfully)) { - if (!$processResult.HasExited) + if (-not $processResult.HasExited) { Write-Output "::warning::The process $($processResult.ProcessId) for $test was killed but the tests were successful." } diff --git a/.github/actions/verify-submodule-pull-request/Check-Parent.ps1 b/.github/actions/verify-submodule-pull-request/Check-Parent.ps1 index 6dc50b369..6c8544f7f 100644 --- a/.github/actions/verify-submodule-pull-request/Check-Parent.ps1 +++ b/.github/actions/verify-submodule-pull-request/Check-Parent.ps1 @@ -3,7 +3,7 @@ param( [string] $Branch ) -if (!($Branch -match '(\w+-\d+)')) +if (-not ($Branch -match '(\w+-\d+)')) { exit } diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 68d60d3a0..281af3c9f 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -75,7 +75,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-838-publish-nuget + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }}