buildkite-agent annotate

The Buildkite agent's annotate command allows you to add additional information to Buildkite build pages using CommonMark Markdown.

Learn more about how to use this command in Annotations.

Creating an annotation

The buildkite-agent annotate command creates an annotation associated with the current build.

Options for the annotate command can be found in the buildkite-agent cli help:

Usage

buildkite-agent annotate [body] [options...]

Description

Build annotations allow you to customize the Buildkite build interface to show information that may surface from your builds. Some examples include:

  • Links to artifacts generated by your jobs
  • Test result summaries
  • Graphs that include analysis about your codebase
  • Helpful information for team members about what happened during a build

Annotations are written in CommonMark-compliant Markdown, with "GitHub Flavored Markdown" extensions.

The annotation body can be supplied as a command line argument, or by piping content into the command. The maximum size of each annotation body is 1MiB.

You can update an existing annotation's body by running the annotate command again and provide the same context as the one you want to update. Or if you leave context blank, it will use the default context.

You can also update only the style of an existing annotation by omitting the body entirely and providing a new style value.

Example

$ buildkite-agent annotate "All tests passed! :your-emoji: like 🚀"
$ cat annotation.md | buildkite-agent annotate --style "warning"
$ buildkite-agent annotate --style "success" --context "junit"
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"

Options

--no-color #

Don't show colors in logging (default: false)
Environment variable: $BUILDKITE_AGENT_NO_COLOR

--debug #

Enable debug mode. Synonym for `--log-level debug`. Takes precedence over `--log-level` (default: false)
Environment variable: $BUILDKITE_AGENT_DEBUG

--log-level value #

Set the log level for the agent, making logging more or less verbose. Defaults to notice. Allowed values are: debug, info, error, warn, fatal (default: "notice")
Environment variable: $BUILDKITE_AGENT_LOG_LEVEL

--experiment value #

Enable experimental features within the buildkite-agent
Environment variable: $BUILDKITE_AGENT_EXPERIMENT

--profile value #

Enable a profiling mode, either cpu, memory, mutex or block
Environment variable: $BUILDKITE_AGENT_PROFILE

--agent-access-token value #

The access token used to identify the agent
Environment variable: $BUILDKITE_AGENT_ACCESS_TOKEN

--endpoint value #

The Agent API endpoint (default: "https://agent.buildkite.com/v3")
Environment variable: $BUILDKITE_AGENT_ENDPOINT

--no-http2 #

Disable HTTP2 when communicating with the Agent API (default: false)
Environment variable: $BUILDKITE_NO_HTTP2

--debug-http #

Enable HTTP debug mode, which dumps all request and response bodies to the log (default: false)
Environment variable: $BUILDKITE_AGENT_DEBUG_HTTP

--trace-http #

Enable HTTP trace mode, which logs timings for each HTTP request. Timings are logged at the debug level unless a request fails at the network level in which case they are logged at the error level (default: false)
Environment variable: $BUILDKITE_AGENT_TRACE_HTTP

--context value #

The context of the annotation used to differentiate this annotation from others. This value has a limit of 100 characters.
Environment variable: $BUILDKITE_ANNOTATION_CONTEXT

--style value #

The style of the annotation (`success`, `info`, `warning` or `error`)
Environment variable: $BUILDKITE_ANNOTATION_STYLE

--append #

Append to the body of an existing annotation (default: false)
Environment variable: $BUILDKITE_ANNOTATION_APPEND

--priority value #

The priority of the annotation (`1` to `10`). Annotations with a priority of `10` are shown first, while annotations with a priority of `1` are shown last. (default: 3)
Environment variable: $BUILDKITE_ANNOTATION_PRIORITY

--job value #

Which job should the annotation come from
Environment variable: $BUILDKITE_JOB_ID

--scope value #

The scope of the annotation, which will control where the annotation is displayed in the Buildkite UI. One of 'build', 'job' (default: "build")
Environment variable: $BUILDKITE_ANNOTATION_SCOPE

--redacted-vars value #

Pattern of environment variable names containing sensitive values (default: "*_PASSWORD", "*_SECRET", "*_TOKEN", "*_PRIVATE_KEY", "*_ACCESS_KEY", "*_SECRET_KEY", "*_CONNECTION_STRING")
Environment variable: $BUILDKITE_REDACTED_VARS

Removing an annotation

Annotations can be removed using the buildkite-agent annotation remove command.