diff --git a/assets/images/help/repository/previous-run-attempts.png b/assets/images/help/repository/previous-run-attempts.png new file mode 100644 index 000000000000..cf33de5c28d5 Binary files /dev/null and b/assets/images/help/repository/previous-run-attempts.png differ diff --git a/assets/images/help/repository/re-run-selected-job.png b/assets/images/help/repository/re-run-selected-job.png new file mode 100644 index 000000000000..4c57b7871dcb Binary files /dev/null and b/assets/images/help/repository/re-run-selected-job.png differ diff --git a/assets/images/help/repository/re-run-single-job-from-log.png b/assets/images/help/repository/re-run-single-job-from-log.png new file mode 100644 index 000000000000..26fbf9765aa8 Binary files /dev/null and b/assets/images/help/repository/re-run-single-job-from-log.png differ diff --git a/assets/images/help/repository/rerun-failed-jobs-drop-down.png b/assets/images/help/repository/rerun-failed-jobs-drop-down.png new file mode 100644 index 000000000000..5e7411550381 Binary files /dev/null and b/assets/images/help/repository/rerun-failed-jobs-drop-down.png differ diff --git a/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md b/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md index 1c987384209b..56e5c6387608 100644 --- a/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md +++ b/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md @@ -1,6 +1,6 @@ --- title: Re-running workflows and jobs -intro: You can re-run a workflow run up to 30 days after its initial run. +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. permissions: People with write permissions to a repository can re-run workflows in the repository. miniTocMaxHeadingLevel: 3 redirect_from: @@ -15,9 +15,11 @@ versions: {% data reusables.actions.enterprise-beta %} {% data reusables.actions.enterprise-github-hosted-runners %} -## Re-running all the jobs in a workflow +## About re-running workflows and jobs + +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. -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. +## Re-running all the jobs in a workflow {% webui %} @@ -26,7 +28,9 @@ Re-running a workflow uses the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` ( {% data reusables.repositories.navigate-to-workflow %} {% data reusables.repositories.view-run %} {% ifversion fpt or ghes > 3.2 or ghae-issue-4721 or ghec %} -1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs** +1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**. + + If no jobs failed, you will not see the **Re-run jobs** drop-down menu. Instead, click **Re-run all jobs**. ![Rerun checks drop-down menu](/assets/images/help/repository/rerun-checks-drop-down.png) {% endif %} {% ifversion ghes < 3.3 or ghae %} @@ -54,8 +58,56 @@ gh run watch {% endcli %} +{% if re-run-jobs %} +## Re-running failed jobs in a workflow + +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. + +{% webui %} + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.actions-tab %} +{% data reusables.repositories.navigate-to-workflow %} +{% data reusables.repositories.view-run %} +1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run failed jobs**. + ![Re-run failed jobs drop-down menu](/assets/images/help/repository/rerun-failed-jobs-drop-down.png) + +{% endwebui %} + +{% cli %} + +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. + +{% endcli %} + +## Re-running a specific job in a workflow + +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. + +{% webui %} + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.actions-tab %} +{% data reusables.repositories.navigate-to-workflow %} +{% data reusables.repositories.view-run %} +1. Next to the job that you want to re-run, click {% octicon "sync" aria-label="The re-run icon" %}. + ![Re-run selected job](/assets/images/help/repository/re-run-selected-job.png) + + Alternatively, click on a job to view the log. In the log, click {% octicon "sync" aria-label="The re-run icon" %}. + ![Re-run selected job](/assets/images/help/repository/re-run-single-job-from-log.png) + +{% endwebui %} + +{% cli %} + +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. + +{% endcli %} + +{% endif %} + {% ifversion fpt or ghes > 3.2 or ghae-issue-4721 or ghec %} -### Reviewing previous workflow runs +## Reviewing previous workflow runs 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,8 +115,13 @@ You can view the results from your previous attempts at running a workflow. You {% data reusables.repositories.actions-tab %} {% data reusables.repositories.navigate-to-workflow %} {% data reusables.repositories.view-run %} +{%- if re-run-jobs %} +1. Any previous run attempts are shown in the **Latest** drop-down menu. + ![Previous run attempts](/assets/images/help/repository/previous-run-attempts.png) +{%- else %} 1. Any previous run attempts are shown in the left pane. ![Rerun workflow](/assets/images/help/settings/actions-review-workflow-rerun.png) +{%- endif %} 1. Click an entry to view its results. {% endif %} diff --git a/content/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs.md b/content/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs.md index ee19cf7ffeaf..ae7c5898c8c7 100644 --- a/content/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs.md +++ b/content/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs.md @@ -63,6 +63,16 @@ You can download the log files from your workflow run. You can also download a w ![Download logs drop-down menu](/assets/images/help/repository/download-logs-drop-down-updated-2.png) + {% if re-run-jobs %} + + {% note %} + + **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. + + {% endnote %} + + {% endif %} + ## Deleting logs You can delete the log files from your workflow run. {% data reusables.repositories.permissions-statement-write %} diff --git a/data/features/re-run-jobs.yml b/data/features/re-run-jobs.yml new file mode 100644 index 000000000000..31a13136bad1 --- /dev/null +++ b/data/features/re-run-jobs.yml @@ -0,0 +1,7 @@ +# Issue 4722 +# Re-running failed jobs in an Actions workflow +versions: + fpt: '*' + ghec: '*' + ghes: '>=3.5' + ghae: 'issue-4722'