Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

use_github_action

Use a specific GitHub Actions workflow


Description

Configure an individual, specific GitHub Actions workflow, either one of the examples from r-lib/actions/examples or a custom workflow given by the url parameter.

Usage

use_github_action(
  name,
  url = NULL,
  save_as = NULL,
  ignore = TRUE,
  open = FALSE
)

use_github_action_check_release(
  save_as = "R-CMD-check.yaml",
  ignore = TRUE,
  open = FALSE
)

use_github_action_check_standard(
  save_as = "R-CMD-check.yaml",
  ignore = TRUE,
  open = FALSE
)

use_github_action_check_full(
  save_as = "R-CMD-check.yaml",
  ignore = TRUE,
  open = FALSE,
  repo_spec = NULL
)

use_github_action_pr_commands(
  save_as = "pr-commands.yaml",
  ignore = TRUE,
  open = FALSE
)

Arguments

name

Name of the workflow file, with or without a .yaml extension.

url

The full URL to the .yaml file. By default, the corresponding workflow in https://github.com/r-lib/actions will be used.

save_as

Name of the workflow file. Defaults to fs::path_file(url) for use_github_action().

ignore

Should the newly created file be added to .Rbuildignore?

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

repo_spec

Optional GitHub repo specification in this form: owner/repo. This can usually be inferred from the GitHub remotes of active project.

use_github_action_check_release()

This workflow installs the latest release of R on macOS and runs R CMD check via the rcmdcheck package.

use_github_action_check_standard()

This workflow runs R CMD check via the rcmdcheck package on the three major operating systems (linux, macOS, and Windows) on the latest release of R and on R-devel. This workflow is appropriate for a package that is (or will hopefully be) on CRAN or Bioconductor.

use_github_action_check_full()

This workflow runs R CMD check at least once on each of the three major operating systems (linux, macOS, and Windows) and on the current release, devel, and four previous versions of R. This is how the tidyverse team checks its packages, but it may be overkill for less widely used packages. Consider using the more streamlined workflows set up by use_github_actions() or use_github_action_check_standard().

use_github_action_pr_commands()

This workflow enables the use of two R-specific commands in pull request issue comments:

  • /document to run roxygen2::roxygenise() and update the PR

  • /style to run styler::style_pkg() and update the PR

See Also

github_actions for generic workflows and badge generation.


usethis

Automate Package and Project Setup

v2.0.1
MIT + file LICENSE
Authors
Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.