Reading and writing GitHub Actions workflow files

write_workflow(x, file = stdout(), ...)

r2yaml(x)

read_workflows(path = ".github/workflows")

read_workflow(file, ...)

Arguments

x

[list()] as created by the workflow functions.

file

either a character string naming a file or a connection open for writing

...

arguments to as.yaml

path

[character()] giving the directory from the repository root where to find GitHub Actions workflows. Defaults to ".github/workflows".

Value

[list()] of lists from yaml.

Details

It is not necessary to escape characters with special meaning in yaml; the underlying yaml::write_yaml() does this automatically.

If a workflow is not name:d, the file name will be used as a name: , as per the GitHub Actions documentation.

Functions

  • write_workflow: Write one GitHub Actions workflow to file.

  • r2yaml: Convert R list to YAML string.

  • read_workflows: Read in one or more GitHub Actions workflows from file(s).

  • read_workflow: Read in one GitHub Actions workflow from a file.