ghactions (version 0.4.1)

rscript_byod: Create Rscript-byod action to run arbitrary R expressions

Description

Thin wrapper around GitHub actions.

Usage

rscript_byod(IDENTIFIER, needs, options = c("--verbose", "--echo"),
  expr = NULL, file = NULL, args = NULL)

Arguments

IDENTIFIER

[character(1)] giving the name of the action or workflow block.

Used:

  • as an informative label on GitHub.com,

  • in the needs fields of other action blocks to model the workflow graph,

  • in the resolves fields of other workflow blocks to model the workflow graph.

needs

[character()] giving the actions (by their IDENTIFIERs) that must complete successfully before this action will be invoked. Defaults to NULL for no upstream dependencies.

options

a list of options, all beginning with --. These can be any of the options of the standard R front-end, and also those described in the details.

expr

any syntactically valid R expression.

file

the name of a file containing R commands. - indicates stdin.

args

arguments to be passed to the script in file.

...

arguments passed on to other methods, not currently used.

Docker

This action requires a Docker image called literally repo:latest in github/workspace. See vignette for details. Use build_image() to create one in a prior action.

This action or workflow requires that you bring-your-own-dockerfile (byod). There has to be a Dockerfile at the root of your repository. It's easy to set one up using use_dockerfile(). To learn more, consider the vignette.

Details

expr here accepts R expressions (say, 1+1) for your convenience, not quoted expressions (say, "1+1") as in the original Rscript. expr is best used for very few lines; if you have more code, consider placing it in a separate R script for file.

args differs from the generic args in other GitHub actions: It only gets appended to the Rscript call when a file is provided.

You can only provide expr or file.

These functions are for advanced users knowledgeable about GitHub actions. Novice users may be better served by the complete templates in workflows.

These functions provide very thin wrappers around existing GitHub actions, including actions from other repositories. Essentially, they just create lists ready to be ingested by make_action_block(), which then turns these R lists into valid GitHub actions syntax blocks.

For documentation on these actions, consult their respective README.mds linked in the below. Some variants of these action wrappers include sensible defaults for frequent uses in R.

The uses field is always hardcoded to a particular commit or tag of the underlying github action to ensure compatibility.

To render an action block completely from scratch, you can always use the templating function make_action_block().

See Also

Other actions: docker_cli, document, filter, firebase, ghpages, install_deps, netlify, rsync

Other byod: website