Description
What happened?
I'm working on a personal prototype project to pull data from github and compute some metrics on it.
My current goal is to use the "List Workflow Runs for a Repository" endpoint to retrieve data on Workflow Runs. I'm using this block of code to retrieve the data:
const workflowRuns = await octokitClient.paginate(octokitClient.actions.listWorkflowRunsForRepo, {
owner,
repo,
});
I actually pulled data from this octokit/rest.js
repository since it has a lot of data I can analyze for testing purposes, which is where I noticed the potential issue.
This is a partial copy of one of the Workflow Run entries in the response where I noticed the issue:
{
id: 8900779163,
name: 'Issue/PR response',
node_id: 'WFR_kwLOFWkwyc8AAAACEoccmw',
head_branch: 'main',
head_sha: 'b4e210293dda57f66e8b0391f4dc5d67b2cb5025',
path: '.github/workflows/immediate-response.yml',
... (more data),
url: 'https://api.github.com/repos/octokit/rest.js/actions/runs/8900779163',
html_url: 'https://github.com/octokit/rest.js/actions/runs/8900779163',
pull_requests: [
{
url: 'https://api.github.com/repos/AmirulAndalib/rest.js/pulls/28',
id: 2535943355,
number: 28,
head: [Object],
base: [Object]
}
],
created_at: '2024-04-30T19:53:37Z',
updated_at: '2025-06-05T03:59:41Z',
... (more data),
run_started_at: '2024-04-30T19:53:37Z',
}
Specifically, the created_at
/run_started_at
and updated_at
fields seem to indicate that it took over a year for this workflow run to complete. However, if you look at the actual workflow run, the duration is listed as 14 seconds.
Is there an actual bug here, or am I assuming incorrectly that I can use the updated_at
field as a proxy for when a workflow run finished?
If I am making an incorrect assumption, would it be possible to update the endpoint to include a run_finished_at
datapoint or something similar?
Versions
I'm using:
- "@octokit/rest": "^21.1.1"
- Node v22.12.0
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Type
Projects
Status