Skip to content

Commit 550704c

Browse files
Update psscriptanalyzer-check.yml
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent ef8ba02 commit 550704c

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/psscriptanalyzer-check.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
psscriptanalyzer:
2222
name: PowerShell Code Quality Check
2323
runs-on: ubuntu-latest
24+
permissions:
25+
actions: write
26+
contents: read
27+
security-events: write
28+
statuses: write
2429

2530
steps:
2631
- name: 📦 Checkout Repository
@@ -29,7 +34,8 @@ jobs:
2934
- name: 🔎 Run PSScriptAnalyzer and Export SARIF
3035
shell: pwsh
3136
run: |
32-
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser -ErrorAction Stop
37+
$ErrorActionPreference = 'Stop'
38+
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
3339
$htPSA = @{
3440
Path = '.'
3541
Recurse = $true
@@ -78,4 +84,10 @@ jobs:
7884
name: psscriptanalyzer-results
7985
path: psscriptanalyzer-results.sarif
8086
retention-days: 7
87+
88+
- name: 📤 Upload SARIF to GitHub
89+
if: always()
90+
uses: github/codeql-action/upload-sarif@v3
91+
with:
92+
sarif_file: psscriptanalyzer-results.sarif
8193

0 commit comments

Comments
 (0)