You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- "[Using workflow run logs](/actions/managing-workflow-runs/using-workflow-run-logs#viewing-logs-through-github-cli)"
36
+
- "[Viewing workflow run history](/actions/managing-workflow-runs/viewing-workflow-run-history#viewing-workflow-run-history-with-github-cli)"
37
+
- "[Disabling and enabling a workflow](/actions/managing-workflow-runs/disabling-and-enabling-a-workflow#disabling-and-enabling-workflows-through-github-cli)"
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/disabling-and-enabling-a-workflow.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Disabling and enabling a workflow
3
-
intro: 'You can disable and re-enable a workflow using {% data variables.product.prodname_dotcom %} or the REST API.'
3
+
intro: 'You can disable and re-enable a workflow using the {% data variables.product.prodname_dotcom %} UI, the REST API, or {% data variables.product.prodname_cli %}.'
4
4
product: '{% data reusables.gated-features.actions %}'
5
5
versions:
6
6
free-pro-team: '*'
@@ -12,7 +12,7 @@ versions:
12
12
{% data reusables.actions.enterprise-github-hosted-runners %}
13
13
{% data reusables.actions.ae-beta %}
14
14
15
-
Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. You can easily re-enable the workflow again on {% data variables.product.prodname_dotcom %}. You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
15
+
Disabling a workflow allows you to stop a workflow from being triggered without having to delete the file from the repo. You can easily re-enable the workflow again on {% data variables.product.prodname_dotcom %}.
16
16
17
17
Temporarily disabling a workflow can be useful in many scenarios. These are a few examples where disabling a workflow might be helpful:
18
18
@@ -27,7 +27,9 @@ Temporarily disabling a workflow can be useful in many scenarios. These are a fe
27
27
28
28
{% endwarning %}
29
29
30
-
### Disabling a workflow
30
+
### Disabling and enabling workflows with the {% data variables.product.prodname_dotcom %} UI
31
+
32
+
#### Disabling a workflow
31
33
32
34
You can manually disable a workflow so that it won't execute any workflow runs. A disabled workflow is not deleted, and can be re-enabled.
33
35
@@ -42,7 +44,7 @@ You can manually disable a workflow so that it won't execute any workflow runs.
42
44
The disabled workflow is marked {% octicon "stop" aria-label="The stop icon" %} to indicate its status.
43
45

44
46
45
-
### Enabling a workflow
47
+
####Enabling a workflow
46
48
47
49
You can re-enable a workflow that was previously disabled.
48
50
@@ -52,3 +54,23 @@ You can re-enable a workflow that was previously disabled.
### Disabling and enabling workflows with {% data variables.product.prodname_cli %}
59
+
60
+
{% data reusables.actions.actions-cli %}
61
+
62
+
To disable a workflow, use the `workflow disable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to disable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
63
+
64
+
```shell
65
+
gh workflow disable <em>workflow</em>
66
+
```
67
+
68
+
To enable a workflow, use the `workflow enable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to enable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
69
+
70
+
```shell
71
+
gh workflow enable<em>workflow</em>
72
+
```
73
+
74
+
### Disabling and enabling workflows through the REST API
75
+
76
+
You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/downloading-workflow-artifacts.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ versions:
15
15
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %} By default, {% data variables.product.product_name %} stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see "[Configuring the retention period for GitHub Actions artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)."{% endif %}
16
16
{% if currentVersion == "enterprise-server@2.22" %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
17
17
18
+
### Download artifacts with the {% data variables.product.prodname_dotcom %} UI
19
+
18
20
{% data reusables.repositories.permissions-statement-read %}
19
21
20
22
{% data reusables.repositories.navigate-to-repo %}
### Download artifacts with {% data variables.product.prodname_cli %}
34
+
35
+
{% data reusables.actions.actions-cli %}
36
+
37
+
{% data variables.product.prodname_cli %} will download each artifact into separate directories based on the artifact name. If only a single artifact is specified, it will be extracted into the current directory.
38
+
39
+
To download all artifacts generated by a workflow run, use the `run download` subcommand. Replace `run-id` with the ID of the run that you want to download artifacts from. If you don't specify a `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent run.
40
+
41
+
```shell
42
+
gh run download <em>run-id</em>
43
+
```
44
+
45
+
To download a specific artifact from a run, use the `run download` subcommand. Replace `run-id` with the ID of the run that you want to download artifacts from. Replace `artifact-name` with the name of the artifact that you want to download.
46
+
47
+
```shell
48
+
gh run download <em>run-id</em> -n <em>artifact-name</em>
49
+
```
50
+
51
+
You can specify more than one artifact.
52
+
53
+
```shell
54
+
gh run download <em>run-id</em> -n <em>artifact-name-1</em> -n <em>artifact-name-2</em>
55
+
```
56
+
57
+
To download specific artifacts across all runs in a repository, use the `run download` subcommand.
58
+
59
+
```shell
60
+
gh run download -n <em>artifact-name-1</em> -n <em>artifact-name-2</em>
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/manually-running-a-workflow.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Manually running a workflow
3
-
intro: 'When a workflow is configured to run on the `workflow_dispatch` event, you can run the workflow using the REST API or from the Actions tab on {% data variables.product.prodname_dotcom %}.'
3
+
intro: 'When a workflow is configured to run on the `workflow_dispatch` event, you can run the workflow using the Actions tab on {% data variables.product.prodname_dotcom %}, {% data variables.product.prodname_cli %}, or the REST API.'
4
4
product: '{% data reusables.gated-features.actions %}'
5
5
versions:
6
6
free-pro-team: '*'
@@ -31,6 +31,40 @@ To trigger the `workflow_dispatch` event on {% data variables.product.prodname_d
31
31
1. Select the branch where the workflow will run and type the input parameters used by the workflow. Click **Run workflow**.
32
32

33
33
34
+
### Running a workflow using {% data variables.product.prodname_cli %}
35
+
36
+
{% data reusables.actions.actions-cli %}
37
+
38
+
To run a workflow, use the `workflow run` subcommand. Replace the `workflow` parameter with either the name, ID, or file name of the workflow you want to run. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
39
+
40
+
```shell
41
+
gh workflow run <em>workflow</em>
42
+
```
43
+
44
+
If your workflow accepts inputs, {% data variables.product.prodname_cli %} will prompt you to enter them. Alternatively, you can use `-f` or `-F` to add an input in `key=value` format. Use `-F` to read from a file.
45
+
46
+
```shell
47
+
gh workflow run greet.yml -f name=mona -f greeting=hello -F data=@myfile.txt
48
+
```
49
+
50
+
You can also pass inputs as JSON by using standard input.
51
+
52
+
```shell
53
+
echo'{"name":"mona", "greeting":"hello"}'| gh workflow run greet.yml --json
54
+
```
55
+
56
+
To run a workflow on a branch other than the repository's default branch, use the `--ref` flag.
57
+
58
+
```shell
59
+
gh workflow run <em>workflow</em> --ref <em>branch-name</em>
60
+
```
61
+
62
+
To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.
63
+
64
+
```shell
65
+
gh run watch
66
+
```
67
+
34
68
### Running a workflow using the REST API
35
69
36
70
When using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/re-running-a-workflow.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,28 @@ versions:
12
12
{% data reusables.actions.enterprise-github-hosted-runners %}
13
13
{% data reusables.actions.ae-beta %}
14
14
15
+
### Re-run a workflow using the {% data variables.product.prodname_dotcom %} UI
16
+
15
17
{% data reusables.repositories.permissions-statement-write %}
16
18
17
19
{% data reusables.repositories.navigate-to-repo %}
18
20
{% data reusables.repositories.actions-tab %}
19
21
{% data reusables.repositories.navigate-to-workflow %}
20
22
{% data reusables.repositories.view-run %}
21
23
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}{% else %}{% endif %}
24
+
25
+
### Re-run a workflow using {% data variables.product.prodname_cli %}
26
+
27
+
{% data reusables.actions.actions-cli %}
28
+
29
+
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.
30
+
31
+
```shell
32
+
gh run rerun <em>run-id</em>
33
+
```
34
+
35
+
To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/using-workflow-run-logs.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,3 +109,31 @@ After deleting logs, the **Delete all logs** button is removed to indicate that
109
109

110
110
After the logs have been deleted, the **Delete all logs** button is removed to indicate that no log files remain in the workflow run.
111
111
{% endif %}
112
+
113
+
### Viewing logs with {% data variables.product.prodname_cli %}
114
+
115
+
{% data reusables.actions.actions-cli %}
116
+
117
+
To view the log for a specific job, use the `run view` subcommand. Replace `run-id` with the ID of run that you want to view logs for. {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a job from the run. If you don't specify `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent run, and then returns another interactive menu for you to choose a job from the run.
118
+
119
+
```shell
120
+
gh run view <em>run-id</em> --log
121
+
```
122
+
123
+
You can also use the `--job` flag to specify a job ID. Replace `job-id` with the ID of the job that you want to view logs for.
124
+
125
+
```shell
126
+
gh run view --job <em>job-id</em> --log
127
+
```
128
+
129
+
You can use `grep` to search the log. For example, this command will return all log entries that contain the word `error`.
130
+
131
+
```shell
132
+
gh run view --job <em>job-id</em> --log | grep error
133
+
```
134
+
135
+
To filter the logs for any failed steps, use `--log-failed` instead of `--log`.
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/viewing-workflow-run-history.md
+58Lines changed: 58 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,67 @@ versions:
12
12
{% data reusables.actions.enterprise-github-hosted-runners %}
13
13
{% data reusables.actions.ae-beta %}
14
14
15
+
### Viewing workflow run history on {% data variables.product.prodname_dotcom %}
16
+
15
17
{% data reusables.repositories.permissions-statement-read %}
16
18
17
19
{% data reusables.repositories.navigate-to-repo %}
18
20
{% data reusables.repositories.actions-tab %}
19
21
{% data reusables.repositories.navigate-to-workflow %}
20
22
{% data reusables.repositories.view-run %}
23
+
24
+
### Viewing workflow run history with {% data variables.product.prodname_cli %}
25
+
26
+
{% data reusables.actions.actions-cli %}
27
+
28
+
#### Viewing recent workflow runs
29
+
30
+
To list the recent workflow runs, use the `run list` subcommand.
31
+
32
+
```shell
33
+
gh run list
34
+
```
35
+
36
+
To specify the maximum number of runs to return, you can use the `-L` or `--limit` flag . The default is `10`.
37
+
38
+
```shell
39
+
gh run list --limit 5
40
+
```
41
+
42
+
To only return runs for the specified workflow, you can use the `-w` or `--workflow` flag. Replace `workflow` with either the workflow name, workflow ID, or workflow file name. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`.
43
+
44
+
```shell
45
+
gh run list --workflow <em>workflow</em>
46
+
```
47
+
48
+
#### Viewing details for a specific workflow run
49
+
50
+
To display details for a specific workflow run, use the `run view` subcommand. Replace `run-id` with the ID of the run that you want to view. If you don't specify a `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent run.
51
+
52
+
```shell
53
+
gh run view <em>run-id</em>
54
+
```
55
+
56
+
To include job steps in the output, use the `-v` or `--verbose` flag.
57
+
58
+
```shell
59
+
gh run view <em>run-id</em> --verbose
60
+
```
61
+
62
+
To view details for a specific job in the run, use the `-j` or `--job` flag. Replace `job-id` with the ID of the job that you want to view.
63
+
64
+
```shell
65
+
gh run view --job <em>job-id</em>
66
+
```
67
+
68
+
To view the full log for a job, use the `--log` flag.
69
+
70
+
```shell
71
+
gh run view --job <em>job-id</em> --log
72
+
```
73
+
74
+
Use the `--exit-status` flag to exit with a non-zero status if the run failed. For example:
75
+
76
+
```shell
77
+
gh run view 0451 --exit-status &&echo"run pending or passed"
For information on setting up {% data variables.product.prodname_cli %}, see "[Managing GitHub Actions with GitHub CLI](/actions/guides/managing-github-actions-with-github-cli#setting-up-github-cli)."
0 commit comments