Skip to content

Commit 7f73515

Browse files
sabrowning1guntrip
andauthored
EDI-ify "Re-running workflows and jobs" (#56729)
Co-authored-by: Felix Guntrip <[email protected]>
1 parent c0d9cd5 commit 7f73515

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

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

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ versions:
1313
ghec: '*'
1414
---
1515

16-
{% data reusables.actions.enterprise-github-hosted-runners %}
17-
18-
## About re-running workflows and jobs
19-
20-
Re-running a workflow or jobs in a workflow uses the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` (Git ref) of the original event that triggered the workflow run. The workflow will use the privileges of the actor who initially triggered the workflow, not the privileges of the actor who initiated the re-run. You can re-run a workflow or jobs in a workflow for up to 30 days after the initial run. You cannot re-run jobs in a workflow once its logs have passed their retention limits. For more information, see [AUTOTITLE](/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy). When you re-run a workflow or jobs in a workflow, you can enable debug logging for the re-run. This will enable runner diagnostic logging and step debug logging for the re-run. For more information about debug logging, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)
16+
> [!NOTE]
17+
> Re-run workflows use the privileges of the actor who initially triggered the workflow, not the privileges of the actor who initiated the re-run. The workflow will also use the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` (git ref) of the original event that triggered the workflow run.
2118
2219
## Re-running all the jobs in a workflow
2320

@@ -30,7 +27,6 @@ Re-running a workflow or jobs in a workflow uses the same `GITHUB_SHA` (commit S
3027
1. In the upper-right corner of the workflow, re-run jobs.
3128

3229
* If any jobs failed, select the **{% octicon "sync" aria-hidden="true" aria-label="sync" %} Re-run jobs** dropdown menu and click **Re-run all jobs**.
33-
3430
* If no jobs failed, click **Re-run all jobs**.
3531

3632
{% data reusables.actions.enable-debug-logging %}
@@ -39,32 +35,28 @@ Re-running a workflow or jobs in a workflow uses the same `GITHUB_SHA` (commit S
3935

4036
{% cli %}
4137

42-
{% data reusables.cli.cli-learn-more %}
43-
44-
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.
38+
1. To re-run a failed workflow run, use the `run rerun` subcommand, replacing `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.
4539

46-
```shell
47-
gh run rerun RUN_ID
48-
```
40+
```shell copy
41+
gh run rerun RUN_ID
42+
```
4943

50-
{% data reusables.actions.enable-debug-logging-cli %}
44+
{% data reusables.actions.enable-debug-logging-cli %}
5145

52-
```shell
53-
gh run rerun RUN_ID --debug
54-
```
46+
```shell copy
47+
gh run rerun RUN_ID --debug
48+
```
5549

56-
To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.
50+
1. To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.
5751

58-
```shell
59-
gh run watch
60-
```
52+
```shell copy
53+
gh run watch
54+
```
6155

6256
{% endcli %}
6357

6458
## Re-running failed jobs in a workflow
6559

66-
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 deployment protection rules that passed in the previous run will automatically pass in the re-run.
67-
6860
{% webui %}
6961

7062
{% data reusables.repositories.navigate-to-repo %}
@@ -78,7 +70,7 @@ If any jobs in a workflow run failed, you can re-run just the jobs that failed.
7870

7971
{% cli %}
8072

81-
To re-run failed jobs in a workflow run, use the `run rerun` subcommand with the `--failed` flag. Replace `run-id` with the ID of the run for which you want to re-run failed jobs. 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.
73+
To re-run failed jobs in a workflow run, use the `run rerun` subcommand with the `--failed` flag. Replace `RUN_ID` with the ID of the run for which you want to re-run failed jobs. 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.
8274
8375
```shell
8476
gh run rerun RUN_ID --failed
@@ -94,8 +86,6 @@ gh run rerun RUN_ID --failed --debug
9486
9587
## Re-running a specific job in a workflow
9688
97-
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 deployment protection rules that passed in the previous run will automatically pass in the re-run.
98-
9989
{% webui %}
10090
10191
{% data reusables.repositories.navigate-to-repo %}
@@ -110,7 +100,7 @@ When you re-run a specific job in a workflow, a new workflow run will start for
110100
111101
{% cli %}
112102
113-
To re-run a specific job in a workflow run, use the `run rerun` subcommand with the `--job` flag. Replace `job-id` with the ID of the job that you want to re-run.
103+
To re-run a specific job in a workflow run, use the `run rerun` subcommand with the `--job` flag. Replace `JOB_ID` with the ID of the job that you want to re-run.
114104
115105
```shell
116106
gh run rerun --job JOB_ID
@@ -124,14 +114,8 @@ gh run rerun --job JOB_ID --debug
124114
125115
{% endcli %}
126116
127-
## Re-running workflows and jobs with reusable workflows
128-
129-
{% data reusables.actions.partial-reruns-with-reusable %}
130-
131117
## Reviewing previous workflow runs
132118
133-
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 [AUTOTITLE](/rest/actions/workflow-runs#get-a-workflow-run).
134-
135119
{% data reusables.repositories.navigate-to-repo %}
136120
{% data reusables.repositories.actions-tab %}
137121
{% data reusables.repositories.navigate-to-workflow %}

0 commit comments

Comments
 (0)