@@ -33,80 +33,77 @@ def log_events(events, gx_output, for_repository=False):
3333
3434 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#commitcommentevent
3535 if etype == "CommitCommentEvent" :
36- logging_func (f"{ ts } : { actor } created a comment in a commit: [{ payload .get ('comment' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
36+ logging_func (f"{ ts } : { actor } created a comment in a commit: [{ payload .get ('comment' ).get ('html_url' )} ]" , rtype = "90d_events " )
3737 pass
3838
3939 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#createeventA
4040 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#deleteevent
4141 elif etype == "CreateEvent" or etype == "DeleteEvent" :
4242 action = "created" if etype == "CreateEvent" else "deleted"
4343 if payload .get ('ref_type' ) == "repository" :
44- logging_func (f"{ ts } : { actor } { action } a repository: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "v_90d_events " )
44+ logging_func (f"{ ts } : { actor } { action } a repository: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "90d_events " )
4545 else :
46- logging_func (f"{ ts } : { actor } { action } a { payload .get ('ref_type' )} : [{ payload .get ('ref' )} ] in repo [{ event .get ('repo' ).get ('name' )} ]" , rtype = "v_90d_events " )
46+ logging_func (f"{ ts } : { actor } { action } a { payload .get ('ref_type' )} : [{ payload .get ('ref' )} ] in repo [{ event .get ('repo' ).get ('name' )} ]" , rtype = "90d_events " )
4747
4848 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#forkevent
4949 elif etype == "ForkEvent" :
50- logging_func (f"{ ts } : { actor } forked a repository: { event .get ('repo' ).get ('name' )} into { payload .get ('forkee' ).get ('full_name' )} " , rtype = "v_90d_events " )
50+ logging_func (f"{ ts } : { actor } forked a repository: { event .get ('repo' ).get ('name' )} into { payload .get ('forkee' ).get ('full_name' )} " , rtype = "90d_events " )
5151
5252 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#gollumevent
5353 elif etype == "GollumEvent" :
5454 for page in payload .get ('pages' ):
55- logging_func (f"{ ts } : { actor } { page .get ('action' )} Wiki page at [{ page .get ('html_url' )} ]" , rtype = "v_90d_events " )
55+ logging_func (f"{ ts } : { actor } { page .get ('action' )} Wiki page at [{ page .get ('html_url' )} ]" , rtype = "90d_events " )
5656
5757 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#issuecommentevent
5858 elif etype == "IssueCommentEvent" :
59- logging_func (f"{ ts } : { actor } { action } a comment in an Issue [{ payload .get ('issue' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
59+ logging_func (f"{ ts } : { actor } { action } a comment in an Issue [{ payload .get ('issue' ).get ('html_url' )} ]" , rtype = "90d_events " )
6060
6161 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#issuesevent
6262 elif etype == "IssuesEvent" :
63- logging_func (f"{ ts } : { actor } { action } an Issue: [{ payload .get ('issue' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
63+ logging_func (f"{ ts } : { actor } { action } an Issue: [{ payload .get ('issue' ).get ('html_url' )} ]" , rtype = "90d_events " )
6464
6565 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#memberevent
6666 elif etype == "MemberEvent" :
6767 added_who = payload .get ('member' ).get ('login' )
6868 to_repo = event .get ('repo' ).get ('name' )
69- logging_func (f"{ ts } : { actor } { action } a user [{ added_who } ] as a collaborator to repo: [{ to_repo } ]" , rtype = "v_90d_events " )
69+ logging_func (f"{ ts } : { actor } { action } a user [{ added_who } ] as a collaborator to repo: [{ to_repo } ]" , rtype = "90d_events " )
7070
7171 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#publicevent
7272 elif etype == "PublicEvent" :
73- logging_func (f"{ ts } : { actor } switched a repository from PRIVATE to PUBLIC, repo: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "v_90d_events " )
73+ logging_func (f"{ ts } : { actor } switched a repository from PRIVATE to PUBLIC, repo: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "90d_events " )
7474
7575 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pullrequestevent
7676 elif etype == "PullRequestEvent" :
77- logging_func (f"{ ts } : { actor } { action } a PR: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
77+ logging_func (f"{ ts } : { actor } { action } a PR: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "90d_events " )
7878
7979 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pullrequestreviewevent
8080 elif etype == "PullRequestReviewEvent" :
81- logging_func (f"{ ts } : { actor } { action } a PR Review: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
81+ logging_func (f"{ ts } : { actor } { action } a PR Review: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "90d_events " )
8282
8383 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pullrequestreviewcommentevent
8484 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pullrequestreviewthreadevent
8585 elif etype == "PullRequestReviewCommentEvent" or etype == "PullRequestReviewThreadEvent" :
86- logging_func (f"{ ts } : { actor } { action } a comment in PR: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
86+ logging_func (f"{ ts } : { actor } { action } a comment in PR: [{ payload .get ('pull_request' ).get ('html_url' )} ]" , rtype = "90d_events " )
8787
8888 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#pushevent
8989 elif etype == "PushEvent" :
90- logging_func (f"{ ts } : { actor } pushed a total of { len (payload .get ('commits' ))} commits from: [{ payload .get ('ref' )} ]" , rtype = "v_90d_events " )
90+ logging_func (f"{ ts } : { actor } pushed a total of { len (payload .get ('commits' ))} commits from: [{ payload .get ('ref' )} ]" , rtype = "90d_events " )
9191
9292 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#releaseevent
9393 elif etype == "ReleaseEvent" :
94- logging_func (f"{ ts } : { actor } published a Release at [{ payload .get ('release' ).get ('html_url' )} ]" , rtype = "v_90d_events " )
94+ logging_func (f"{ ts } : { actor } published a Release at [{ payload .get ('release' ).get ('html_url' )} ]" , rtype = "90d_events " )
9595
9696 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#sponsorshipevent
9797 elif etype == "SponsorshipEvent" :
98- logging_func (f"{ ts } : { actor } { action } a Sponsorship Event]" , rtype = "v_90d_events " )
98+ logging_func (f"{ ts } : { actor } { action } a Sponsorship Event]" , rtype = "90d_events " )
9999
100100 # https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#watchevent
101101 elif etype == "WatchEvent" :
102- logging_func (f"{ ts } : { actor } starred a repository: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "v_90d_events " )
102+ logging_func (f"{ ts } : { actor } starred a repository: [{ event .get ('repo' ).get ('name' )} ]" , rtype = "90d_events " )
103103 else :
104104 logging_func (f"Missing parser in recent events for: { etype } with { payload } " , rtype = "debug" )
105105
106106
107- # If verbose is enabled, we skip the summary as it becomes redundant.
108- if gx_output .verbose_enabled (): return
109-
110107 # Now let's create the non-debug summarized version of messages.
111108 for (month , etype , action ), count in event_summary .items ():
112109 summary_message = f"In { month } , "
@@ -196,5 +193,4 @@ def log_events(events, gx_output, for_repository=False):
196193
197194
198195 logging_func (summary_message , rtype = "90d_events" )
199- logging_func ("For a detailed individual list of recent public events, use --verbose" , rtype = "90d_events" )
200196 return
0 commit comments