Skip to content

Commit 812a26a

Browse files
committed
Add repository scan
1 parent 3305f27 commit 812a26a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/repo.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# Repository configuration analysis
3+
#
4+
5+
# NOTES:
6+
# This workflow uses PSRule.
7+
# You can read more about these linting tools and configuration options here:
8+
# PSRule - https://aka.ms/ps-rule and https://github.com/Microsoft/PSRule.Rules.GitHub
9+
10+
name: Repository
11+
on:
12+
push:
13+
branches: [ main, 'release/*' ]
14+
pull_request:
15+
branches: [ main, 'release/*' ]
16+
schedule:
17+
- cron: '24 22 * * 0' # At 10:24 PM, on Sunday each week
18+
workflow_dispatch:
19+
20+
jobs:
21+
repo:
22+
name: Repository configuration
23+
runs-on: ubuntu-latest
24+
# if: github.repository == 'microsoft/PSRule'
25+
permissions:
26+
contents: read
27+
security-events: write
28+
steps:
29+
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: Run PSRule analysis
34+
uses: Microsoft/[email protected]
35+
with:
36+
modules: PSRule.Rules.GitHub
37+
outputFormat: Sarif
38+
outputPath: reports/ps-rule-results.sarif
39+
env:
40+
GITHUB_REPOSITORY: ${{ github.repository }}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Upload results to security tab
44+
uses: github/codeql-action/upload-sarif@v1
45+
with:
46+
sarif_file: reports/ps-rule-results.sarif

0 commit comments

Comments
 (0)