mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
test
This commit is contained in:
parent
2cedff5390
commit
35dfe8d86c
1 changed files with 6 additions and 3 deletions
|
|
@ -31,7 +31,6 @@ def report_status(sha, name, start_time, exit=None):
|
||||||
data = {
|
data = {
|
||||||
'name': name,
|
'name': name,
|
||||||
'head_sha': sha,
|
'head_sha': sha,
|
||||||
'status': status,
|
|
||||||
'started_at': start_time,
|
'started_at': start_time,
|
||||||
'output': {
|
'output': {
|
||||||
'title': name,
|
'title': name,
|
||||||
|
|
@ -43,6 +42,10 @@ def report_status(sha, name, start_time, exit=None):
|
||||||
|
|
||||||
if exit is not None:
|
if exit is not None:
|
||||||
data['completed_at'] = datetime.datetime.now(tz=datetime.timezone.utc).isoformat(timespec='seconds')
|
data['completed_at'] = datetime.datetime.now(tz=datetime.timezone.utc).isoformat(timespec='seconds')
|
||||||
|
data['completion'] = status
|
||||||
|
data['status'] = 'completed'
|
||||||
|
else:
|
||||||
|
data['status'] = status
|
||||||
|
|
||||||
req = urllib.request.Request(
|
req = urllib.request.Request(
|
||||||
f"https://api.github.com/repos/pluralkit/pluralkit/check-runs",
|
f"https://api.github.com/repos/pluralkit/pluralkit/check-runs",
|
||||||
|
|
@ -63,7 +66,7 @@ def report_status(sha, name, start_time, exit=None):
|
||||||
except urllib.error.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
response_code = e.getcode()
|
response_code = e.getcode()
|
||||||
response_data = e.read()
|
response_data = e.read()
|
||||||
print(f"{response_code} failed to update status {name}: {response_data}")
|
print(f"{response_code} failed to update status {data}: {response_data}")
|
||||||
global global_fail
|
global global_fail
|
||||||
global_fail = True
|
global_fail = True
|
||||||
|
|
||||||
|
|
@ -84,7 +87,7 @@ def main():
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
data = json.loads(dispatch_data)
|
data = json.loads(dispatch_data)
|
||||||
print("running {dispatch_data}")
|
print(f"running {dispatch_data}")
|
||||||
|
|
||||||
time_started = datetime.datetime.now(tz=datetime.timezone.utc).isoformat(timespec='seconds')
|
time_started = datetime.datetime.now(tz=datetime.timezone.utc).isoformat(timespec='seconds')
|
||||||
report_status(data['sha'], data["action"], time_started)
|
report_status(data['sha'], data["action"], time_started)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue