|
| 1 | +--- |
| 2 | +title: Re-running workflows and jobs |
| 3 | +intro: You can re-run a workflow run up to 30 days after its initial run. |
| 4 | +product: '{% data reusables.gated-features.actions %}' |
| 5 | +permissions: People with write permissions to a repository can re-run workflows in the repository. |
| 6 | +miniTocMaxHeadingLevel: 3 |
| 7 | +redirect_from: |
| 8 | + - /actions/managing-workflow-runs/re-running-a-workflow |
| 9 | +versions: |
| 10 | + fpt: '*' |
| 11 | + ghes: '*' |
| 12 | + ghae: '*' |
| 13 | +--- |
| 14 | + |
| 15 | +{% data reusables.actions.enterprise-beta %} |
| 16 | +{% data reusables.actions.enterprise-github-hosted-runners %} |
| 17 | + |
| 18 | +## Re-running all the jobs in a workflow |
| 19 | + |
| 20 | +Re-running a workflow uses the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` (Git ref) of the original event that triggered the workflow run. You can re-run a workflow for up to 30 days after the initial run. |
| 21 | + |
| 22 | +{% include tool-switcher %} |
| 23 | + |
| 24 | +{% webui %} |
| 25 | + |
| 26 | +{% data reusables.repositories.navigate-to-repo %} |
| 27 | +{% data reusables.repositories.actions-tab %} |
| 28 | +{% data reusables.repositories.navigate-to-workflow %} |
| 29 | +{% data reusables.repositories.view-run %} |
| 30 | +{% ifversion fpt or ghes > 3.2 or ghae-issue-4721 %} |
| 31 | +1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs** |
| 32 | +  |
| 33 | +{% endif %} |
| 34 | +{% ifversion ghes < 3.3 or ghae %} |
| 35 | +1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**. |
| 36 | +  |
| 37 | +{% endif %} |
| 38 | + |
| 39 | +{% endwebui %} |
| 40 | + |
| 41 | +{% cli %} |
| 42 | + |
| 43 | +{% data reusables.cli.cli-learn-more %} |
| 44 | + |
| 45 | +To re-run a failed workflow run, use the `run rerun` subcommand. Replace `run-id` with the ID of the failed run that you want to re-run. If you don't specify a `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent failed run. |
| 46 | + |
| 47 | +```shell |
| 48 | +gh run rerun <em>run-id</em> |
| 49 | +``` |
| 50 | + |
| 51 | +To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list. |
| 52 | + |
| 53 | +```shell |
| 54 | +gh run watch |
| 55 | +``` |
| 56 | + |
| 57 | +{% endcli %} |
| 58 | + |
| 59 | +{% ifversion fpt or ghes > 3.2 or ghae-issue-4721 %} |
| 60 | +### Reviewing previous workflow runs |
| 61 | + |
| 62 | +You can view the results from your previous attempts at running a workflow. You can also view previous workflow runs using the API. For more information, see ["Get a workflow run"](/rest/reference/actions#get-a-workflow-run). |
| 63 | + |
| 64 | +{% data reusables.repositories.navigate-to-repo %} |
| 65 | +{% data reusables.repositories.actions-tab %} |
| 66 | +{% data reusables.repositories.navigate-to-workflow %} |
| 67 | +{% data reusables.repositories.view-run %} |
| 68 | +1. Any previous run attempts are shown in the left pane. |
| 69 | +  |
| 70 | +1. Click an entry to view its results. |
| 71 | + |
| 72 | +{% endif %} |
0 commit comments