Endpoint to get active jobs of each self hosted runner #32141
Replies: 2 comments
-
|
There doesn't appear to be an easy way to do this, but technically the information is available. The approach is incredibly tedious (at least from the v3 api, it might be slightly less painful from the v4 api, but I don't want to look it up). I'm going to hand-wave about how to get the list of
{
[
{
...
"jobs_url": "https://api.github.com/repos/$ORG/$REPO/actions/runs/$RUN_ID/jobs",
...
}
]
}
{
...
"jobs": [
{
...
"labels": [
...
],
"runner_id": $RUNNER_ID,
"runner_name": "$RUNNER_NAME",
"runner_group_id": $RUNNER_GROUP_ID,
"runner_group_name": "$RUNNER_GROUP_NAME"
}
]
}You can then cross check this output against |
Beta Was this translation helpful? Give feedback.
-
|
Years later and we still don't have an endpoint to easily see this info. My use-case: I have a Runner Group created already. I'm trying to pull data from a snapshot in time, listing the runner names included in the runner group, whether they are online, whether they are busy running a job, and what that job/workflow ID is. I can do all of the above except for that last part. I have no easy way to tell what Workflow is running on what Runner. And doing a loop through all of my repos to get this information is not feasible (we have a lot of repos). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi community, we are implementing a tool for monitoring the runners at the organization level. We will like to know when a job last too long to notify to the owner of the job, or just to stop the job using the Rest API.
Currently we can see this information as described here Viewing active jobs in your organization or enterprise
But I haven't found a way to get this information with the Rest API. Is there a way to get such an information without doing so many requests? Is there an endpoint that can perform this query planned to be implemented in the future?
I was looking for something like
/orgs/ORG/actions/runners/RUNNER_ID/active-jobsand get the information of every active job like owner, started time, status, repository info, run_id, job_id, etc.The idea I have is to make a request on every repo of the organization, get a list of the runs, get the jobs that are in_progress and sort them by runner_id. It just sound like a terrible workaround 👎
Thank you very much in advance for your response.
Beta Was this translation helpful? Give feedback.
All reactions