ghr_get: Get a response from the GitHub API.

Description Usage Arguments Value See Also Examples

Description

Get a response from the GitHub API.

Usage

1
ghr_get(path, ref = "master", ...)

Arguments

path

A string formatted as "owner/repo/subdir" or "owner/repo/subdir@branch", e.g.: "maurolepore/ghr/reference@gh-pages".

ref

Branch name.

...

Arguments passed to gh::gh().

Value

A list.

See Also

ghr_fields

Other functions to get github responses: ghr_show_branches

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# The request to GitHub happens only the first time you call ghr_get()
system.time(ghr_get("maurolepore/ghr"))
# Later calls take no time because the first call is memoised
system.time(ghr_get("maurolepore/ghr"))

gh_response <- ghr_get("maurolepore/ghr")
class(gh_response)
length(gh_response)
str(gh_response[[1]])

ghr_pull(ghr_get("maurolepore/ghr", ref = "gh-pages"), "path")
# Same
ghr_pull(ghr_get("maurolepore/ghr@gh-pages"), "path")

maurolepore/ghr documentation built on May 18, 2019, 12:26 p.m.