octo_debug | R Documentation |
These functions are a drop-in replacements for cli::cli_warn()
and friends.
If used while R is running within a GitHub Action, the conditions will be
signaled in such a way that they will create annotations on the files
affected. Even if enable_github_colors()
was used the conditions will not
have colors in the log as the color codes break the annotation.
octo_debug(message, .envir = parent.frame())
octo_inform(
message,
...,
trace = rlang::trace_back(),
title = NULL,
.envir = parent.frame()
)
octo_warn(
message,
...,
trace = rlang::trace_back(),
title = NULL,
.envir = parent.frame()
)
octo_abort(
message,
...,
trace = rlang::trace_back(),
title = NULL,
.envir = parent.frame(),
.fail_fast = getOption("octolog.fail_fast") %||% TRUE
)
message |
It is formatted via a call to |
.envir |
Environment to evaluate the glue expressions in. |
... |
Passed to |
trace |
An |
title |
A custom title for the GitHub annotation. |
.fail_fast |
An error on GitHub will not kill the R process if this is
set to |
Annotations will only have file and line references if the option
keep.source = TRUE
is set. It defaults to FALSE
when in non-interactive
use.
The file path for the annotations will be relative to the R working
directory, if you want to change that set the envvar OCTOLOG_REPO_DIR
to
the dir the path should be relative to. This will be necessary if the current
working directory is not the repository root (e.g. you checked out into a
separate dir), as annotations require the file paths to be relative to the
repository root.
octo_debug
: A debug message which is only visible if the
secret ACTIONS_STEP_DEBUG
is set. For local use set option
octolog.debug = TRUE
.
cli::cli_abort()
Sys.setenv(GITHUB_ACTIONS = "")
octo_warn(c("A warning message", i = "Try something else!"),
title = "Custom Title"
)
Sys.setenv(GITHUB_ACTIONS = "TRUE")
octo_warn(c("A warning message", i = "Try something else!"),
title = "Custom Title"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.