A very long job is flaky near the end and you want to retry only failed jobs.
BeginnerScenarioGitHub Actions
Answer
Situation read → Rerunning the whole workflow wastes time.
What I'd do →
- Use "Re-run failed jobs" in the UI or
gh run rerun <id> --failed. - Split the long job into smaller ones so a retry is cheap.
- Fix the flake, and use step-level retry only for network calls.
Why → Smaller jobs mean smaller retries and clearer failure signals.
Interview tip → Say you quantify flakiness rather than normalise reruns.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate