Skip to content

perf: dedupe listJobsForWorkflowRun pagination#16

Open
webjunkie wants to merge 1 commit intomainfrom
devex/dedupe-jobs-pagination
Open

perf: dedupe listJobsForWorkflowRun pagination#16
webjunkie wants to merge 1 commit intomainfrom
devex/dedupe-jobs-pagination

Conversation

@webjunkie
Copy link
Copy Markdown
Contributor

When both status-job and capture-job-durations are set, the action was paginating listJobsForWorkflowRun twice — once to find the status job, once to emit per-job duration events. Fetch jobs into a single array up front and reuse it, halving GitHub API calls per run for callers using both features.

Why bother
Heavy CI users (e.g. posthog/posthog runs the action twice per workflow with both features on, against a dedicated GitHub App token) burn a couple hundred extra requests/hour for no reason. Not currently rate-limited, but easy win.

Behavior
No functional change. Same events emitted, same warning when status job is missing.

When both status-job and capture-job-durations were set the action
paginated listJobsForWorkflowRun twice — once to find the status
job, once to emit per-job duration events. Fetch jobs into a
single array up front and reuse it for both, halving GitHub API
calls per run on workloads that use both features.

No behavior change otherwise.
@webjunkie webjunkie marked this pull request as ready for review April 29, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant