-
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.12 KB
/
lint-powershell.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: PSScriptAnalyzer
defaults:
run:
shell: pwsh
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '22 1 * * 3'
permissions:
contents: read
jobs:
build:
permissions:
contents: read
security-events: write
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install AnyPackage
run: Install-Module AnyPackage -Force -AllowClobber
- name: Install ConvertToSARIF
run: Install-Module ConvertToSARIF -Force
- name: Install Microsoft.PowerShell.PSResourceGet
run: Install-Module Microsoft.PowerShell.PSResourceGet -Force -AllowClobber -AllowPrerelease
- name: Run PSScriptAnalyzer
run: |
Import-Module AnyPackage, ConvertToSARIF, Microsoft.PowerShell.PSResourceGet -PassThru
Invoke-ScriptAnalyzer -Path . -Recurse | ConvertTo-SARIF -FilePath results.sarif
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif