File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ markdown_overview_temp.md
1717markdown_security_temp.md
1818.DS_Store
1919* .pyc
20- test.py
20+ test.py
21+ * .cpython-312.pyc
Original file line number Diff line number Diff line change 11__author__ = 'socket.dev'
2- __version__ = '1.0.0 '
2+ __version__ = '1.0.1 '
Original file line number Diff line number Diff line change 2424global committer
2525global gh_api_token
2626global github_repository_owner
27+ global event_action
2728
2829github_variables = [
2930 "GITHUB_SHA" ,
4041 "GITHUB_ACTOR" ,
4142 "GITHUB_ENV" ,
4243 "GH_API_TOKEN" ,
43- "GITHUB_REPOSITORY_OWNER"
44+ "GITHUB_REPOSITORY_OWNER" ,
45+ "EVENT_ACTION"
4446]
4547
4648for env in github_variables :
@@ -80,6 +82,7 @@ class Github:
8082 github_env : str
8183 api_token : str
8284 project_id : int
85+ event_action : str
8386
8487 def __init__ (self ):
8588 self .commit_sha = github_sha
@@ -100,6 +103,7 @@ def __init__(self):
100103 self .github_env = github_env
101104 self .api_token = gh_api_token
102105 self .project_id = 0
106+ self .event_action = event_action
103107 if self .api_token is None :
104108 print ("Unable to get Github API Token from GH_API_TOKEN" )
105109 sys .exit (2 )
@@ -111,12 +115,18 @@ def check_event_type() -> str:
111115 event_type = "main"
112116 else :
113117 event_type = "diff"
118+ elif github_event_name .lower () == "pull_request" :
119+ if event_action is not None and event_action != "" and event_action .lower () == "opened" :
120+ event_type = "diff"
121+ else :
122+ log .info (f"Pull Request Action { event_action } is not a supported type" )
123+ sys .exit (0 )
114124 elif github_event_name .lower () == "issue_comment" :
115125 event_type = "comment"
116126 else :
117127 event_type = None
118128 log .error (f"Unknown event type { github_event_name } " )
119- sys .exit (1 )
129+ sys .exit (0 )
120130 return event_type
121131
122132 @staticmethod
You can’t perform that action at this time.
0 commit comments