File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ $allowedPlaceholders = @(
5151
5252$violations = New-Object System.Collections.Generic.List[string ]
5353
54+ $excludedFiles = @ (
55+ ' Scripts/security/pre-push-security-check.ps1' ,
56+ ' Scripts/security/install-git-hooks.ps1'
57+ )
58+
5459foreach ($r in $refs ) {
5560 if ($r.LocalSha -match ' ^0+$' ) { continue }
5661
@@ -61,7 +66,17 @@ foreach ($r in $refs) {
6166 if (-not $patch ) { continue }
6267
6368 $lines = $patch -split " `n "
69+ $currentFile = ' '
6470 foreach ($line in $lines ) {
71+ if ($line.StartsWith (' +++ b/' )) {
72+ $currentFile = $line.Substring (6 ).Trim()
73+ continue
74+ }
75+
76+ if ($excludedFiles -contains $currentFile ) {
77+ continue
78+ }
79+
6580 if (-not $line.StartsWith (' +' )) { continue }
6681 if ($line.StartsWith (' +++' )) { continue }
6782
You can’t perform that action at this time.
0 commit comments