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
Copy file name to clipboardExpand all lines: content/actions/learn-github-actions/workflow-commands-for-github-actions.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -254,13 +254,13 @@ jobs:
254
254
::echo::off
255
255
```
256
256
257
-
The `echo` command lets you enable or disable echoing of workflow commands. For example, if you use the `set-output` command in a workflow, it sets an output parameter but the workflow run log does not show the command itself. If you enable command echoing, then the log shows the command output, like`::set-output name={name}::{value}`.
257
+
Enables or disables echoing of workflow commands. For example, if you use the `set-output` command in a workflow, it sets an output parameter but the workflow run's log does not show the command itself. If you enable command echoing, then the log shows the command, such as`::set-output name={name}::{value}`.
258
258
259
-
Command echoing is disabled by default. A workflow command is echoed if any error occurs processing the command, however.
259
+
Command echoing is disabled by default. However, a workflow command is echoed if there are any error occurs processing the command.
260
260
261
-
You can enable command echoing globally by turning on step debug logging (`ACTIONS_STEP_DEBUG` secret). For more information, see "[Enabling debug logging](/actions/managing-workflow-runs/enabling-debug-logging)". In contrast, the `echo` command lets you enable command echoing more granular.
261
+
The `add-mask`, `debug`, `warning`, and `error` commands do not support echoing because their outputs are already echoed to the log.
262
262
263
-
The commands `debug`, `notice`, `warning`, and `error` do not support echoing because they print messages to the log anyway.
263
+
You can also enable command echoing globally by turning on step debug logging using the `ACTIONS_STEP_DEBUG` secret. For more information, see "[Enabling debug logging](/actions/managing-workflow-runs/enabling-debug-logging)". In contrast, the `echo` workflow command lets you enable command echoing at a more granular level, rather than enabling it for every workflow in a repository.
264
264
265
265
### Example toggling command echoing
266
266
@@ -278,13 +278,15 @@ jobs:
278
278
echo '::set-output name=action_echo::disabled'
279
279
```
280
280
281
-
Turns command echoing on and off and sets an output parameter in both states. Only the second `set-output` and `echo` commands will show in the log because command echoing is enabled when they are run. Command echoing is disabled when all other commands are run and they are thus not printed. The output parameter is set in all cases.
281
+
The step above prints the following lines to the log:
282
282
283
283
```
284
284
::set-output name=action_echo::enabled
285
285
::echo::off
286
286
```
287
287
288
+
Only the second `set-output` and `echo` workflow commands are included in the log because command echoing was only enabled when they were run. Even though it is not always echoed, the output parameter is set in all cases.
289
+
288
290
## Sending values to the pre and post actions
289
291
290
292
You can use the `save-state` command to create environment variables for sharing with your workflow's `pre:` or `post:` actions. For example, you can create a file with the `pre:` action, pass the file location to the `main:` action, and then use the `post:` action to delete the file. Alternatively, you could create a file with the `main:` action, pass the file location to the `post:` action, and also use the `post:` action to delete the file.
0 commit comments