R/repo_set_forking.R

Defines functions repo_set_forking

Documented in repo_set_forking

#' @rdname repo_core
#' @param status Logical. Should forking be allowed for the repository. Default `TRUE`.
#' @export
#'
repo_set_forking = function(repo, status = TRUE) {

  arg_is_chr(repo)
  arg_is_lgl(status)

  res = purrr::map2(
    repo, status,
    function(repo, status) {
      res = purrr::safely(github_api_repo_edit)(repo, allow_forking = status)
      status_msg(
        res,
        "Changed the forking status of repo {.val {repo}} to {.val {status}}.",
        "Failed to change forking status of repo {.val {repo}}."
      )
    }
  )

  invisible(res)
}

Try the ghclass package in your browser

Any scripts or data that you put into this service are public.

ghclass documentation built on Aug. 31, 2026, 5:08 p.m.