Skip to main content

Examples of writing GitHub workflow messages to stdout.

---
title: GitHub workflow commands for message output
subtitle: Examples of writing GitHub workflow messages to stdout.
author: GitHub
date: May 21, 2024
source: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
snippet: https://jonlabelle.com/snippets/view/markdown/github-workflow-commands-for-message-output
gist: https://gist.github.com/jonlabelle/69c79a59c69d2f0bff6dda9348f3fa2d
notoc: false
---

Use the `::` syntax to run the workflow commands within your YAML file; these
commands are then sent to the runner over stdout.

## Message output

### Debug

Prints a debug message to the log. You must create a secret named
`ACTIONS_STEP_DEBUG` with the value true to see the debug messages set by this
command in the log.

> [!NOTE]
> Requires [debug logging enabled](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging).

```console
::debug::{message}
```

> [Debug message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-debug-message)

#### Example debug messages

```yaml
run: echo "::debug::Set the Octocat variable"
```

### Notice

Creates a notice message and prints the message to the log. This message will
create an annotation, which can associate the message with a particular file
in your repository. Optionally, your message can specify a position within the
file.

```console
::notice file={name},line={line},endLine={endLine},title={title}::{message}
```

#### Example notice messages

Creates a notice message and prints the message to the log. This message will
create an annotation, which can associate the message with a particular file
in your repository. Optionally, your message can specify a position within the
file.

```yml
run: echo "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon"

run: echo "::notice title=Heads up::I need to make you aware of something"

run: echo "::notice title=✓ Test passed::Have a great rest of the day/night!"
```

> [Notice message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message)

### Warning

Creates a warning message and prints the message to the log. This message will
create an annotation, which can associate the message with a particular file
in your repository. Optionally, your message can specify a position within the
file.

```console
::warning file={name},line={line},endLine={endLine},title={title}::{message}
```

#### Example warning messages

```yaml
run: echo "::warning file=app.js,line=1,col=5,endColumn=7::Missing semicolon"

run: echo "::warning title=Oops::Something didn't go quite as expected"
```

> [Warning message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message)

### Error

Creates an error message and prints the message to the log. This message will
create an annotation, which can associate the message with a particular file
in your repository. Optionally, your message can specify a position within the
file.

```console
::error file={name},line={line},endLine={endLine},title={title}::{message}
```

#### Example error messages

```yaml
run: echo "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon"

run: echo "::error title=Uh oh::Something failed. Here are some steps to correct the problem."

run: echo "::error title=✘ Test failed::You probably want to fix this."
```

> [Error message documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)