Sub topic 4
Re-running from the web interface
This chapter assumes you can read a workflow file and have used the Actions tab. You also need write access to the repository, because read-only users can view runs but cannot re-run them.
The web interface is the quickest way to re-run a run when you are already looking at a failure. It offers all three scopes from the previous chapters and has a checkbox for debug logging.
Where the controls are
Open the repository, select the Actions tab, and click a workflow run. The run's summary page has three parts that matter here:
- The header, with the re-run button at the top right.
- The left sidebar, which lists each job in the run.
- The attempt selector, which appears after the first re-run and reads something like Attempt #2.
The re-run controls are available only once the run has finished. While jobs are still queued or running, the buttons are disabled. Re-runs are also limited in time. GitHub allows them for up to 30 days after the original run.
Re-running all jobs
- Open the finished run.
- Click Re-run all jobs at the top right.
- In the dialog, optionally select Enable debug logging.
- Click Re-run jobs.
This creates a new attempt in which every job starts again, including jobs that passed. Use it when a passing job might depend on state that a failed job changed, or when you want a clean, complete result.
Re-running only the failed jobs
- Open the finished run.
- Click the arrow next to the re-run button to open the menu.
- Choose Re-run failed jobs.
- In the dialog, optionally select Enable debug logging, then confirm.
This re-runs failed jobs and any jobs that depend on them through needs. Jobs that already succeeded keep their results from the earlier attempt. The option is available only after every job in the run has completed, so it is not offered while an unrelated job is still running.
Re-running a single job
You can re-run one job in two ways:
- Hover over the job in the left sidebar and click the re-run icon.
- Open the job's page and choose the single-job option in the re-run menu, labelled Re-run this job.
Either way you get the same confirmation dialog with the debug logging checkbox. Single-job re-runs are useful for a flaky job when you do not want to spend runner minutes on its neighbours. Jobs that depend on the one you re-run are re-run as well.
The debug logging checkbox
The Enable debug logging checkbox appears in every re-run dialog. When selected, the new attempt writes both step debug logs and runner diagnostic logs. The setting applies to that attempt only. The next time you re-run, the box is cleared and you must select it again.
This makes it the safest first move when a failure is unclear. You get more detail without changing any repository setting and without affecting other runs. Turning debug logging on for every run is covered in a later chapter.
Comparing attempts
After a re-run, the run page shows the latest attempt. Use the Attempt #N selector to switch to an earlier attempt. Each attempt keeps its own job results and logs, so you can compare a failing attempt with a passing one. For a flaky test, this comparison often shows which step varies.
Common problems
- The re-run buttons are greyed out. The run is still in progress, or you lack write access.
- No "Re-run failed jobs" option. Either nothing failed, or some jobs are still running.
- The re-run fails the same way. A re-run reuses the original commit and workflow file. If the failure comes from the code, editing the workflow in a newer commit will not change a re-run. Push a new commit instead.
- The debug output is missing. Check that you selected the checkbox for this particular re-run, and that you are viewing the new attempt rather than an earlier one.
Exercise
A run has three jobs: build and lint passed, and test failed. The test failure looks like a timeout, and you want more detail without re-running build or lint. Which web interface action do you take, and which option in the dialog do you select?
Show answer
Open the finished run, open the re-run menu, and choose Re-run failed jobs (or use the re-run icon on the test job for a single-job re-run). In the dialog, select Enable debug logging. The new attempt re-runs only the failed job, build and lint keep their earlier results, and the debug setting applies to that attempt only.