MCPcopy
hub / github.com/521xueweihan/HelloGitHub / check_condition

Function check_condition

script/github_bot/github_bot.py:104–119  ·  view source on GitHub ↗

过滤条件

(data)

Source from the content-addressed store, hash-verified

102
103
104def check_condition(data):
105 """
106 过滤条件
107 """
108 create_time = datetime.datetime.strptime(
109 data['created_at'], "%Y-%m-%dT%H:%M:%SZ") + datetime.timedelta(hours=8)
110 date_condition = create_time >= (datetime.datetime.now()
111 - datetime.timedelta(days=DAY))
112 if (data['type'] == 'WatchEvent') and date_condition:
113 # 不统计自己项目的star事件
114 if data['payload']['action'] == 'started' and \
115 ACCOUNT['username'] not in data['repo']['name']:
116 data['date_time'] = create_time.strftime("%Y-%m-%d %H:%M:%S")
117 return True
118 else:
119 return False
120
121
122def analyze(json_data):

Callers 1

analyzeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected