Skip to content

Commit 50d8ad5

Browse files
Create msdo-gitleaks.yml
Adding in gitleaks workflow based on my msdo-reusable.yml file
1 parent acdf5b2 commit 50d8ad5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: msdo-gitleaks-reusable
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
inputs:
7+
branch:
8+
required: false
9+
type: string
10+
default: 'main'
11+
secrets:
12+
GH_TOKEN:
13+
required: false
14+
15+
jobs:
16+
gitleaks-scan:
17+
name: Gitleaks Secret Scan
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: read
22+
security-events: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
ref: ${{ inputs.branch }}
30+
31+
- name: Run Gitleaks
32+
id: gitleaks
33+
uses: gitleaks/gitleaks-action@v2
34+
with:
35+
args: detect --source=. --report-format sarif --report-path=gitleaks.sarif
36+
37+
- name: Upload SARIF to GitHub Code Scanning
38+
if: github.repository_visibility == 'public'
39+
uses: github/codeql-action/upload-sarif@v3
40+
with:
41+
sarif_file: gitleaks.sarif

0 commit comments

Comments
 (0)