Skip to content

Commit 4b60546

Browse files
committed
Add repository scan
1 parent 9cca988 commit 4b60546

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/repo.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Run PSRule analysis
33+
uses: Microsoft/[email protected]
34+
with:
35+
modules: PSRule.Rules.GitHub
36+
outputFormat: Sarif
37+
outputPath: reports/ps-rule-results.sarif
38+
env:
39+
GITHUB_REPOSITORY: ${{ github.repository }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Upload results to security tab
43+
uses: github/codeql-action/upload-sarif@v1
44+
with:
45+
sarif_file: reports/ps-rule-results.sarif

0 commit comments

Comments
 (0)