Test CI
This commit is contained in:
parent
f4364c6398
commit
4c3b506937
3 changed files with 73 additions and 1 deletions
30
packages/forgejo-report-checks/forgejo-report-checks.py
Normal file
30
packages/forgejo-report-checks/forgejo-report-checks.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
from pyforgejo import AuthenticatedClient
|
||||
from pyforgejo.api.repository import repo_create_status
|
||||
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"])
|
||||
|
||||
print("hello")
|
||||
|
||||
with open('result.json', 'r') as file:
|
||||
data = json.load(file)
|
||||
|
||||
for result in data['results']:
|
||||
attr = result['attr']
|
||||
success = result['success']
|
||||
type = result['type']
|
||||
print(attr)
|
||||
response = repo_create_status.sync_detailed(
|
||||
owner="aciceri",
|
||||
repo="nixfleet",
|
||||
sha=environ["GITHUB_SHA"],
|
||||
client=client,
|
||||
body=CreateStatusOption(
|
||||
context=type,
|
||||
description=attr,
|
||||
target_url="https://google.com",
|
||||
state="success" if success else "failure" # ma be pending,success,failure,error_message
|
||||
)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue