-
Notifications
You must be signed in to change notification settings - Fork 172
48 lines (41 loc) · 1.68 KB
/
PowerShell.yaml
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
47
48
name: 'PowerShell'
on:
push:
branches: [ "main", "releases/*" ]
paths: ["**.ps1", "**.psm1", "**.psd1", ".github/workflows/powershell.yaml" ]
pull_request:
branches: [ "main", "releases/*" ]
paths: ["**.ps1", "**.psm1", "**.psd1", ".github/workflows/powershell.yaml" ]
permissions:
contents: read
jobs:
PSScriptAnalyzer:
# https://github.com/microsoft/psscriptanalyzer-action
# For more information on PSScriptAnalyzer in general, see
# https://github.com/PowerShell/PSScriptAnalyzer
name: Run PSScriptAnalyzer
runs-on: ubuntu-latest
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f # v1.1
with:
path: .\
recurse: true
excludeRule: '"PSAvoidUsingInvokeExpression", "PSUseShouldProcessForStateChangingFunctions", "PSAvoidUsingWriteHost", "PSAvoidUsingCmdletAliases", "PSUseSingularNouns", "PSUseApprovedVerbs"'
output: results.sarif
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
with:
sarif_file: results.sarif
RunTests:
name: Run PS Tests
runs-on: windows-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run PS Tests
run: |
. (Join-Path "." "build/scripts/tests/runTests.ps1")