Is there an API that can automatically retrieve workflow data from the action backend? #188189
-
Why are you starting this discussion?Question What GitHub Actions topic or product is this about?Metrics & Insights Discussion DetailsIs there an API that can automatically retrieve workflow data from the action backend? I can see it on the frontend page, but is there a way to automate the retrieval and processing of this data? The download link for the file isn't visible on the frontend; I can only click it directly. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Hey! For workflow data, the GitHub REST API has endpoints like /repos/{owner}/{repo}/actions/runs and /actions/jobs to retrieve run and job details. If you need artifacts (like logs or ZIPs), there's /actions/artifacts. You can also use the GraphQL API to query similar data. That should let you automate retrieval. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
|
Right now, GitHub does NOT provide any API to retrieve the data shown under “Insights → Actions → Performance metrics.” That dashboard is generated internally and is not exposed through the REST or GraphQL API. The only workflow‑related data you can automate comes from the standard Actions endpoints (runs, jobs, logs, artifacts, etc.), like: But the performance metrics view itself isn’t available programmatically, so there’s currently no way to download or query that exact dataset through an API. |
Beta Was this translation helpful? Give feedback.
-
|
Yes — you can retrieve GitHub Actions workflow data programmatically using the GitHub REST API. For workflow runs: List workflow runs: Get a specific run: Download logs for a run: If you're referring to usage metrics (minutes, storage, etc.), you can use: GET /repos/{owner}/{repo}/actions/usage GET /orgs/{org}/actions/usage You’ll need a personal access token (PAT) with appropriate repo or actions:read permissions. Example using curl: curl -H "Authorization: Bearer YOUR_TOKEN" The frontend download buttons typically call these same APIs internally. You can automate retrieval by calling the endpoints directly and processing the JSON response. If you need more advanced querying, you can also use the GitHub GraphQL API for workflow metadata. |
Beta Was this translation helpful? Give feedback.
Right now, GitHub does NOT provide any API to retrieve the data shown under “Insights → Actions → Performance metrics.” That dashboard is generated internally and is not exposed through the REST or GraphQL API.
The only workflow‑related data you can automate comes from the standard Actions endpoints (runs, jobs, logs, artifacts, etc.), like:
But the performance metrics view itself isn’t available programmatically, so there’s currently no way to download or query that exact dataset through an API.