Skip to content

Commit 018e9ad

Browse files
authored
Merge pull request #34 from samsmithnz/PowerShellSecurityScan
Create PowerShell security scan file
2 parents 5e9c2e2 + 24dd4a1 commit 018e9ad

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/powershell.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
#
6+
# https://github.com/microsoft/action-psscriptanalyzer
7+
# For more information on PSScriptAnalyzer in general, see
8+
# https://github.com/PowerShell/PSScriptAnalyzer
9+
10+
name: PSScriptAnalyzer
11+
12+
on:
13+
push:
14+
branches: [ "main" ]
15+
pull_request:
16+
branches: [ "main" ]
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
permissions:
24+
contents: read # for actions/checkout to fetch code
25+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
26+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
27+
name: PSScriptAnalyzer
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
32+
- name: Run PSScriptAnalyzer
33+
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f
34+
with:
35+
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options.
36+
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
37+
path: .\
38+
recurse: true
39+
# Include your own basic security rules. Removing this option will run all the rules
40+
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
41+
output: results.sarif
42+
43+
# Upload the SARIF file generated in the previous step
44+
- name: Upload SARIF results file
45+
uses: github/codeql-action/upload-sarif@v2
46+
with:
47+
sarif_file: results.sarif

0 commit comments

Comments
 (0)