Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 29bea21

Browse files
committed
feat: Add more information from workflow execution
1 parent 3032ae2 commit 29bea21

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

src/app.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@ def process_workflow_job():
5151
workflow = job["workflow_job"]["workflow_name"]
5252
time_start = parse_datetime(job["workflow_job"]["started_at"])
5353
repository = job["repository"]["full_name"]
54+
repository_private = job["repository"]["private"]
5455
action = job["action"]
56+
conclusion = job["workflow_job"].get("conclusion")
57+
requestor = job.get("sender", {}).get("login")
58+
runner_name = job["workflow_job"]["runner_name"]
59+
runner_group_name = job["workflow_job"]["runner_group_name"]
60+
runner_public = (runner_group_name == "GitHub Actions")
5561

5662
context_details = {
5763
"action": action,
5864
"repository": repository,
5965
"job_id": job_id,
6066
"workflow": workflow,
67+
"requestor": requestor,
6168
}
6269

6370
if action == "queued":
@@ -71,7 +78,14 @@ def process_workflow_job():
7178
time_to_start = 0
7279
else:
7380
time_to_start = (time_start - datetime.fromtimestamp(job_requested)).seconds
74-
context_details["time_to_start"] = time_to_start
81+
82+
extra_data = {
83+
"time_to_start": time_to_start,
84+
"runner_name": runner_name,
85+
"runner_public": runner_public,
86+
"repository_private": repository_private
87+
}
88+
context_details = {**context_details, **extra_data}
7589

7690
elif action == "completed":
7791
job_requested = jobs.get(job_id)
@@ -84,7 +98,12 @@ def process_workflow_job():
8498
).seconds
8599
# delete from memory
86100
del jobs[job_id]
87-
context_details["time_to_finish"] = time_to_finish
101+
102+
extra_data = {
103+
"time_to_finish": time_to_finish,
104+
"conclusion": conclusion
105+
}
106+
context_details = {**context_details, **extra_data}
88107
else:
89108
app.logger.warning(f"Unknown action {action}, removing from memory")
90109
if job_id in jobs:

0 commit comments

Comments
 (0)