diff --git a/NEWS.md b/NEWS.md index e03d54adc..32aae1a23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,8 @@ shiny development * HTML dependencies that are sent to dynamic UI now have better type checking, and no longer require a `dep.src.href` field. (#3537) +* Default for `ref` input in `runGithub()` changed from `"master"` to `"HEAD"`. (#3346) + * When taking a test snapshot, the sort order of the json keys of the `input`, `output`, and `export` fields is currently sorted using the locale of the machine. This can lead to inconsistent test snapshot results. To opt-in to a consistent ordering of snapshot fields with `{shinytest}`, please set the global option `options(shiny.snapshotsortc = TRUE)`. `{shinytest2}` users do not need to set this value. (#3515) ### Bug fixes diff --git a/R/run-url.R b/R/run-url.R index 84c5dd9f0..a41ffcdd8 100644 --- a/R/run-url.R +++ b/R/run-url.R @@ -121,7 +121,8 @@ runGist <- function(gist, destdir = NULL, ...) { #' @param username GitHub username. If `repo` is of the form #' `"username/repo"`, `username` will be taken from `repo`. #' @param ref Desired git reference. Could be a commit, tag, or branch name. -#' Defaults to `"master"`. +#' Defaults to `"HEAD"`, which means the default branch on GitHub, typically +#' `"main"` or `"master"`. #' @export #' @examples #' ## Only run this example in interactive R sessions @@ -133,7 +134,7 @@ runGist <- function(gist, destdir = NULL, ...) { #' runGitHub("shiny_example", "rstudio", subdir = "inst/shinyapp/") #' } runGitHub <- function(repo, username = getOption("github.user"), - ref = "master", subdir = NULL, destdir = NULL, ...) { + ref = "HEAD", subdir = NULL, destdir = NULL, ...) { if (grepl('/', repo)) { res <- strsplit(repo, '/')[[1]] diff --git a/man/runUrl.Rd b/man/runUrl.Rd index 54382b684..53b7a682c 100644 --- a/man/runUrl.Rd +++ b/man/runUrl.Rd @@ -13,7 +13,7 @@ runGist(gist, destdir = NULL, ...) runGitHub( repo, username = getOption("github.user"), - ref = "master", + ref = "HEAD", subdir = NULL, destdir = NULL, ... @@ -47,7 +47,8 @@ all valid values.} \code{"username/repo"}, \code{username} will be taken from \code{repo}.} \item{ref}{Desired git reference. Could be a commit, tag, or branch name. -Defaults to \code{"master"}.} +Defaults to \code{"HEAD"}, which means the default branch on GitHub, typically +\code{"main"} or \code{"master"}.} } \description{ \code{runUrl()} downloads and launches a Shiny application that is hosted at