octo_mask_value: Masking a value or envvar in the GHA log.

View source: R/commands.R

octo_mask_valueR Documentation

Masking a value or envvar in the GHA log.

Description

This will mask either a value or an envvar and prevent them (or their content) from showing up in the GitHub Actions log.
ATTENTION: Currently the masking of envvar values will only take effect in the NEXT step of the workflow. Values that are masked directly are masked immediately. This is not very clear in the GitHub Docs but very important.

Usage

octo_mask_value(value)

octo_mask_envvar(name)

Arguments

value

A single value to mask, coercible to string.

name

Name of the envvar to mask.

Details

The masking is not restricted to R output, rather it will work for any logged output. For a practical demonstration please see the octolog example workflow

Additionally some values and envvars will be masked automatically by github, though this behavior is poorly documented. It looks like anything with "TOKEN" will be masked. Related Issues here and here.

See Also

GitHub Docs

Examples

octo_mask_value("secret_token123")
# The mask takes effect in the NEXT step
print("Current token: secret_token123")
# Will log as
# "Current token:***"

Sys.setenv("SECRET_TOKEN" = "007")
octo_mask_envvar("SECRET_TOKEN")
# The mask takes effect in the NEXT step
print(Sys.getenv("SECRET_TOKEN"))
# Will log as
# "***"

assignUser/octolog documentation built on June 4, 2023, 3:28 p.m.