CI script to report checks to forgejo
This commit is contained in:
parent
45a78e44b4
commit
54d97e55d9
2 changed files with 9 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
|||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
fleetFlake,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -24,6 +25,7 @@ let
|
|||
curl
|
||||
tea
|
||||
attic-client
|
||||
fleetFlake.packages.${pkgs.system}.forgejo-report-checks
|
||||
]
|
||||
}; do
|
||||
for bin in "$dir"/bin/*; do
|
||||
|
|
|
@ -6,16 +6,17 @@ from os import environ
|
|||
|
||||
client = AuthenticatedClient(base_url=environ["GITHUB_API_URL"], token=environ["GITHUB_TOKEN"])
|
||||
|
||||
print("hello")
|
||||
|
||||
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']
|
||||
print(attr)
|
||||
print(f"Report status success={success} for {type} {attr}")
|
||||
response = repo_create_status.sync_detailed(
|
||||
owner="aciceri",
|
||||
repo="nixfleet",
|
||||
|
@ -24,7 +25,9 @@ for result in data['results']:
|
|||
body=CreateStatusOption(
|
||||
context=type,
|
||||
description=attr,
|
||||
target_url="https://google.com",
|
||||
target_url="https://git.aciceri.dev", # FIXME
|
||||
state="success" if success else "failure" # ma be pending,success,failure,error_message
|
||||
)
|
||||
)
|
||||
|
||||
print("Done reporting statuses")
|
||||
|
|
Loading…
Add table
Reference in a new issue