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
17
17
markdown_security_temp.md
18
18
.DS_Store
19
19
* .pyc
20
- test.py
20
+ test.py
21
+ * .cpython-312.pyc
Original file line number Diff line number Diff line change 1
1
__author__ = 'socket.dev'
2
- __version__ = '1.0.0 '
2
+ __version__ = '1.0.1 '
Original file line number Diff line number Diff line change 24
24
global committer
25
25
global gh_api_token
26
26
global github_repository_owner
27
+ global event_action
27
28
28
29
github_variables = [
29
30
"GITHUB_SHA" ,
40
41
"GITHUB_ACTOR" ,
41
42
"GITHUB_ENV" ,
42
43
"GH_API_TOKEN" ,
43
- "GITHUB_REPOSITORY_OWNER"
44
+ "GITHUB_REPOSITORY_OWNER" ,
45
+ "EVENT_ACTION"
44
46
]
45
47
46
48
for env in github_variables :
@@ -80,6 +82,7 @@ class Github:
80
82
github_env : str
81
83
api_token : str
82
84
project_id : int
85
+ event_action : str
83
86
84
87
def __init__ (self ):
85
88
self .commit_sha = github_sha
@@ -100,6 +103,7 @@ def __init__(self):
100
103
self .github_env = github_env
101
104
self .api_token = gh_api_token
102
105
self .project_id = 0
106
+ self .event_action = event_action
103
107
if self .api_token is None :
104
108
print ("Unable to get Github API Token from GH_API_TOKEN" )
105
109
sys .exit (2 )
@@ -111,12 +115,18 @@ def check_event_type() -> str:
111
115
event_type = "main"
112
116
else :
113
117
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 )
114
124
elif github_event_name .lower () == "issue_comment" :
115
125
event_type = "comment"
116
126
else :
117
127
event_type = None
118
128
log .error (f"Unknown event type { github_event_name } " )
119
- sys .exit (1 )
129
+ sys .exit (0 )
120
130
return event_type
121
131
122
132
@staticmethod
You can’t perform that action at this time.
0 commit comments