Unable to re-run multiple specific failed jobs via the GitHub Actions API #176756
Replies: 2 comments
|
Great question — this is actually a known limitation of the current GitHub Actions API design. When you re-run a single job using the API (POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun), GitHub creates a new workflow attempt behind the scenes. Because of that, any remaining failed jobs are now associated with the previous attempt, and the API’s restriction (HTTP 403: only jobs from the current attempt can be re-run) kicks in. In short: ✅ You can re-run a specific job from the latest attempt. 🚫 Once a new attempt starts, older failed jobs can’t be retried individually because they’re considered part of an archived attempt. There’s currently no official endpoint to re-run multiple selected jobs in a single call — only rerun_all_failed_jobs or one-by-one re-runs. Possible workarounds: Use the gh api Or create a custom workflow dispatch that accepts job names or IDs as input, then dynamically triggers only those jobs. If you want this feature natively, consider opening or upvoting a feature request on github/feedback Would definitely be useful to have a rerun_selected_jobs endpoint exposed — your reasoning makes sense! |
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Body
👋 hey there!
I was trying to use the GitHub Actions API/CLI to re-run a subset of failed jobs from a workflow, and it seems this isn’t currently possible — though it feels like it should be.
At the moment, we can:
However, there’s no way to re-run multiple specific jobs (for example, 2 out of 5 failed ones). If I want to retry them I need to do it one by one calling the rerun single job endpoint.
When I try to re-run a second job individually, I get the following error:
{ "message": "Only jobs from the current attempt can be re-run", "documentation_url": "https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run", gh: Only jobs from the current attempt can be re-run (HTTP 403) "status": "403" }This suggests that after one job re-run creates a new attempt, the remaining failed jobs can no longer be retried individually.
Question:
Is this limitation intentional?
Given that the API already supports re-running all failed jobs, it seems like re-running a list of specific jobs should also be possible — or at least exposed as an option.
All reactions