Skip to content

Commit fa09bc5

Browse files
committed
Fixed detection for files in the commit files change
1 parent 0db5904 commit fa09bc5

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.1.32"
9+
version = "2.1.33"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.1.32'
2+
__version__ = '2.1.33'

socketsecurity/core/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,20 @@ def has_manifest_files(self, files: list) -> bool:
389389
from .utils import socket_globs as fallback_patterns
390390
patterns = fallback_patterns
391391

392+
# Normalize all file paths for matching
393+
norm_files = [f.replace('\\', '/').lstrip('./') for f in files]
394+
392395
for ecosystem in patterns:
393396
ecosystem_patterns = patterns[ecosystem]
394397
for file_name in ecosystem_patterns:
395398
pattern_str = ecosystem_patterns[file_name]["pattern"]
396-
for file in files:
397-
if "\\" in file:
398-
file = file.replace("\\", "/")
399-
if PurePath(file).match(pattern_str):
400-
return True
399+
# Expand brace patterns for each manifest pattern
400+
expanded_patterns = Core.expand_brace_pattern(pattern_str)
401+
for exp_pat in expanded_patterns:
402+
for file in norm_files:
403+
# Use PurePath.match for glob-like matching
404+
if PurePath(file).match(exp_pat):
405+
return True
401406
return False
402407

403408
def check_file_count_limit(self, file_count: int) -> dict:

workflows/github-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
# Prevent concurrent runs for the same commit
1717
concurrency:
18-
group: socket-scan-${{ github.ref }}-${{ github.sha }}
18+
group: socket-scan-${{ github.sha }}
1919
cancel-in-progress: true
2020

2121
jobs:

0 commit comments

Comments
 (0)