Format
This commit is contained in:
parent
a45c032180
commit
d2237c0a12
12 changed files with 352 additions and 392 deletions
|
@ -4,18 +4,20 @@ from pyforgejo.models.create_status_option import CreateStatusOption
|
|||
import json
|
||||
from os import environ
|
||||
|
||||
client = AuthenticatedClient(base_url=environ["GITHUB_API_URL"], token=environ["GITHUB_TOKEN"])
|
||||
client = AuthenticatedClient(
|
||||
base_url=environ["GITHUB_API_URL"], token=environ["GITHUB_TOKEN"]
|
||||
)
|
||||
|
||||
with open('result.json', 'r') as file:
|
||||
with open("result.json", "r") as file:
|
||||
data = json.load(file)
|
||||
|
||||
print("Reporting statuses acording to the following result.json")
|
||||
print(json.dumps(data, indent=2))
|
||||
|
||||
for result in data['results']:
|
||||
attr = result['attr']
|
||||
success = result['success']
|
||||
type = result['type']
|
||||
for result in data["results"]:
|
||||
attr = result["attr"]
|
||||
success = result["success"]
|
||||
type = result["type"]
|
||||
print(f"Report status success={success} for {type} {attr}")
|
||||
response = repo_create_status.sync_detailed(
|
||||
owner="aciceri",
|
||||
|
@ -26,8 +28,10 @@ for result in data['results']:
|
|||
context=type,
|
||||
description=attr,
|
||||
target_url="https://git.aciceri.dev", # FIXME
|
||||
state="success" if success else "failure" # may be pending,success,failure,error_message
|
||||
)
|
||||
state=(
|
||||
"success" if success else "failure"
|
||||
), # may be pending,success,failure,error_message
|
||||
),
|
||||
)
|
||||
|
||||
print("Done reporting statuses")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue