chore(deps): bump softprops/action-gh-release from 2 to 3 #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PSScriptAnalyzer | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run PSScriptAnalyzer | |
| shell: pwsh | |
| run: | | |
| if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules } | |
| $results = Invoke-ScriptAnalyzer -Path . -Recurse -ExcludeRule PSAvoidUsingWriteHost,PSAvoidUsingCmdletAliases,PSUseShouldProcessForStateChangingFunctions | |
| $errors = $results | Where-Object Severity -eq 'Error' | |
| $warnings = $results | Where-Object Severity -eq 'Warning' | |
| if ($results) { | |
| $results | Format-Table -Property RuleName, Severity, ScriptName, Line, Message -AutoSize | |
| } | |
| if ($errors) { | |
| Write-Error "PSScriptAnalyzer found errors." | |
| exit 1 | |
| } |