Skip to content

Commit 62c079c

Browse files
Sarah Edwardscdblucascosti
authored
re-running workflow jobs (#25817)
Co-authored-by: Cameron Booth <[email protected]> Co-authored-by: Lucas Costi <[email protected]>
1 parent dcbb7b2 commit 62c079c

File tree

7 files changed

+79
-5
lines changed

7 files changed

+79
-5
lines changed
33 KB
Loading
22.6 KB
Loading
13 KB
Loading
17.5 KB
Loading

content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Re-running workflows and jobs
3-
intro: You can re-run a workflow run up to 30 days after its initial run.
3+
intro: You can re-run a workflow run{% if re-run-jobs %}, all failed jobs in a workflow run, or specific jobs in a workflow run{% endif %} up to 30 days after its initial run.
44
permissions: People with write permissions to a repository can re-run workflows in the repository.
55
miniTocMaxHeadingLevel: 3
66
redirect_from:
@@ -15,9 +15,11 @@ versions:
1515
{% data reusables.actions.enterprise-beta %}
1616
{% data reusables.actions.enterprise-github-hosted-runners %}
1717

18-
## Re-running all the jobs in a workflow
18+
## About re-running workflows and jobs
19+
20+
Re-running a workflow{% if re-run-jobs %} or jobs in a workflow{% endif %} 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{% if re-run-jobs %} or jobs in a workflow{% endif %} for up to 30 days after the initial run.
1921

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.
22+
## Re-running all the jobs in a workflow
2123

2224
{% webui %}
2325

@@ -26,7 +28,9 @@ Re-running a workflow uses the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` (
2628
{% data reusables.repositories.navigate-to-workflow %}
2729
{% data reusables.repositories.view-run %}
2830
{% ifversion fpt or ghes > 3.2 or ghae-issue-4721 or ghec %}
29-
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**
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+
If no jobs failed, you will not see the **Re-run jobs** drop-down menu. Instead, click **Re-run all jobs**.
3034
![Rerun checks drop-down menu](/assets/images/help/repository/rerun-checks-drop-down.png)
3135
{% endif %}
3236
{% ifversion ghes < 3.3 or ghae %}
@@ -54,17 +58,70 @@ gh run watch
5458

5559
{% endcli %}
5660

61+
{% if re-run-jobs %}
62+
## Re-running failed jobs in a workflow
63+
64+
If any jobs in a workflow run failed, you can re-run just the jobs that failed. When you re-run failed jobs in a workflow, a new workflow run will start for all failed jobs and their dependents. Any outputs for any successful jobs in the previous workflow run will be used for the re-run. Any artifacts that were created in the initial run will be available in the re-run. Any environment protection rules that passed in the previous run will automatically pass in the re-run.
65+
66+
{% webui %}
67+
68+
{% data reusables.repositories.navigate-to-repo %}
69+
{% data reusables.repositories.actions-tab %}
70+
{% data reusables.repositories.navigate-to-workflow %}
71+
{% data reusables.repositories.view-run %}
72+
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run failed jobs**.
73+
![Re-run failed jobs drop-down menu](/assets/images/help/repository/rerun-failed-jobs-drop-down.png)
74+
75+
{% endwebui %}
76+
77+
{% cli %}
78+
79+
You cannot re-run all failed jobs through the {% data variables.product.prodname_cli %} at this time. Instead, use the {% data variables.product.product_name %} web browser interface.
80+
81+
{% endcli %}
82+
83+
## Re-running a specific job in a workflow
84+
85+
When you re-run a specific job in a workflow, a new workflow run will start for the job and any dependents. Any outputs for any other jobs in the previous workflow run will be used for the re-run. Any artifacts that were created in the initial run will be available in the re-run. Any environment protection rules that passed in the previous run will automatically pass in the re-run.
86+
87+
{% webui %}
88+
89+
{% data reusables.repositories.navigate-to-repo %}
90+
{% data reusables.repositories.actions-tab %}
91+
{% data reusables.repositories.navigate-to-workflow %}
92+
{% data reusables.repositories.view-run %}
93+
1. Next to the job that you want to re-run, click {% octicon "sync" aria-label="The re-run icon" %}.
94+
![Re-run selected job](/assets/images/help/repository/re-run-selected-job.png)
95+
96+
Alternatively, click on a job to view the log. In the log, click {% octicon "sync" aria-label="The re-run icon" %}.
97+
![Re-run selected job](/assets/images/help/repository/re-run-single-job-from-log.png)
98+
99+
{% endwebui %}
100+
101+
{% cli %}
102+
103+
You cannot re-run a single job through the {% data variables.product.prodname_cli %} at this time. Instead, use the {% data variables.product.product_name %} browser interface.
104+
105+
{% endcli %}
106+
107+
{% endif %}
108+
57109
{% ifversion fpt or ghes > 3.2 or ghae-issue-4721 or ghec %}
58-
### Reviewing previous workflow runs
110+
## Reviewing previous workflow runs
59111

60112
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).
61113

62114
{% data reusables.repositories.navigate-to-repo %}
63115
{% data reusables.repositories.actions-tab %}
64116
{% data reusables.repositories.navigate-to-workflow %}
65117
{% data reusables.repositories.view-run %}
118+
{%- if re-run-jobs %}
119+
1. Any previous run attempts are shown in the **Latest** drop-down menu.
120+
![Previous run attempts](/assets/images/help/repository/previous-run-attempts.png)
121+
{%- else %}
66122
1. Any previous run attempts are shown in the left pane.
67123
![Rerun workflow](/assets/images/help/settings/actions-review-workflow-rerun.png)
124+
{%- endif %}
68125
1. Click an entry to view its results.
69126

70127
{% endif %}

content/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ You can download the log files from your workflow run. You can also download a w
6363
![Download logs drop-down menu](/assets/images/help/repository/download-logs-drop-down-updated-2.png)
6464

6565

66+
{% if re-run-jobs %}
67+
68+
{% note %}
69+
70+
**Note**: When you download the log archive for a workflow that was partially re-run, the archive only includes the jobs that were re-run. To get a complete set of logs for jobs that were run from a workflow, you must download the log archives for the previous run attempts that ran the other jobs.
71+
72+
{% endnote %}
73+
74+
{% endif %}
75+
6676
## Deleting logs
6777

6878
You can delete the log files from your workflow run. {% data reusables.repositories.permissions-statement-write %}

data/features/re-run-jobs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Issue 4722
2+
# Re-running failed jobs in an Actions workflow
3+
versions:
4+
fpt: '*'
5+
ghec: '*'
6+
ghes: '>=3.5'
7+
ghae: 'issue-4722'

0 commit comments

Comments
 (0)