Use HEAD for ref instead of master in runGitHub() (#3564)

Co-authored-by: Kathryn Doering <kathryn.doering@noaa.gov>
This commit is contained in:
Kathryn Doering
2022-02-14 15:53:33 -05:00
committed by GitHub
parent 2c82ee0235
commit 5c03326a8c
3 changed files with 8 additions and 4 deletions

View File

@@ -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

View File

@@ -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]]

View File

@@ -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