meow: 'cat()' for GitHub output variables

View source: R/meow.R

meowR Documentation

cat() for GitHub output variables

Description

cat() for GitHub output variables

Usage

meow(name, thing)

Arguments

thing

a vector that can be passed to cat()

the

name of the output variable to write to

Details

This is a way to print output for GitHub that requires you to pipe output into the GITHUB_OUTPUT environment variable. This will write single-line variables as var=value and multiline variables using a random key according to this guidance from GitHub to avoid injection: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings

Value

nothing. This is used to write output for GitHub

Examples

# NOTE: this function is not exported
tmp <- tempfile()
env <- Sys.getenv("GITHUB_OUTPUT", unset = "")
on.exit(Sys.setenv("GITHUB_OUTPUT" = env))
Sys.setenv("GITHUB_OUTPUT" = tmp)
vise <- asNamespace("vise")
vise$meow("single", "hello!")
vise$meow("multi", c("This information", "exists on", "multiple lines"))
writeLines(readLines(tmp))

zkamvar/vise documentation built on Oct. 27, 2023, 9:18 a.m.