Gets the content of a file from GitHub, from any repo the user can read, and writes it into the active project. This function wraps an endpoint of the GitHub API which supports specifying a target reference (i.e. branch, tag, or commit) and which follows symlinks.
Usage
use_pr_checklist(
repo_spec = "maurolepore/rsetools",
path = ".github/pull_request_template.md"
)
Arguments
- repo_spec
A string identifying the GitHub repo or, alternatively, a GitHub file URL. Acceptable forms:
Plain
OWNER/REPO
specA blob URL, such as
"https://github.com/OWNER/REPO/blob/REF/path/to/some/file"
A raw URL, such as
"https://raw.githubusercontent.com/OWNER/REPO/REF/path/to/some/file"
In the case of a URL, the
path
,ref
, andhost
are extracted from it, in addition to therepo_spec
.- path
Path of file to copy, relative to the GitHub repo it lives in. This is extracted from
repo_spec
when user provides a URL.
Value
See the corresponding function in usethis.