diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f3ccd9..2f1558d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,13 +29,11 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run PSScriptAnalyzer - uses: microsoft/psscriptanalyzer-action@main - with: - path: './' - recurse: true - output: results.sarif - - name: Upload SARIF results - if: always() - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif \ No newline at end of file + shell: pwsh + run: | + $results = Invoke-ScriptAnalyzer -Path ./ -Recurse -Severity Error + if ($results) { + $results | Format-Table -AutoSize + throw "PSScriptAnalyzer found $($results.Count) error(s)" + } + Write-Output "PSScriptAnalyzer: No errors found" \ No newline at end of file