Skip to content

Commit bb5364e

Browse files
committed
consistent scm configs
1 parent 9a60042 commit bb5364e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

socketsecurity/core/scm/github.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class GithubConfig:
2222
repository: str
2323
ref_name: str
2424
default_branch: bool
25+
is_default_branch: bool
2526
pr_number: Optional[str]
2627
pr_name: Optional[str]
2728
commit_message: Optional[str]
@@ -46,6 +47,7 @@ def from_env(cls) -> 'GithubConfig':
4647
owner = repository.split('/')[0]
4748
repository = repository.split('/')[1]
4849

50+
is_default = os.getenv('DEFAULT_BRANCH', '').lower() == 'true'
4951
return cls(
5052
sha=os.getenv('GITHUB_SHA', ''),
5153
api_url=os.getenv('GITHUB_API_URL', ''),
@@ -54,7 +56,8 @@ def from_env(cls) -> 'GithubConfig':
5456
workspace=os.getenv('GITHUB_WORKSPACE', ''),
5557
repository=repository,
5658
ref_name=os.getenv('GITHUB_REF_NAME', ''),
57-
default_branch=os.getenv('DEFAULT_BRANCH', '').lower() == 'true',
59+
default_branch=is_default,
60+
is_default_branch=is_default,
5861
pr_number=os.getenv('PR_NUMBER'),
5962
pr_name=os.getenv('PR_NAME'),
6063
commit_message=os.getenv('COMMIT_MESSAGE'),

0 commit comments

Comments
 (0)