Skip to contents

Get info of a file in a Github repo

Usage

get_file_info_from_gh(
  owner = getOption("pipfun.ghowner"),
  repo,
  branch = "main",
  file_path
)

Arguments

owner

character: owner of repo

repo

character: repository name

branch

character: branch where the file is

file_path

character: file path

Value

Complete response from GET method of Github API

Examples

get_file_info_from_gh(owner     = getOption("pipfun.ghowner"),
                      repo      = "pip_info",
                      file_path = "releases.csv",
                      branch    = "releases")
#> Git credentials are missing or invalid in non-interactive mode.
#> $name
#> [1] "releases.csv"
#> 
#> $path
#> [1] "releases.csv"
#> 
#> $sha
#> [1] "6aeea0afa8ed6a92dc0e3455e73ae06c1bbce376"
#> 
#> $size
#> [1] 73
#> 
#> $url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/contents/releases.csv?ref=releases"
#> 
#> $html_url
#> [1] "https://github.com/PIP-Technical-Team/pip_info/blob/releases/releases.csv"
#> 
#> $git_url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/git/blobs/6aeea0afa8ed6a92dc0e3455e73ae06c1bbce376"
#> 
#> $download_url
#> [1] "https://raw.githubusercontent.com/PIP-Technical-Team/pip_info/releases/releases.csv"
#> 
#> $type
#> [1] "file"
#> 
#> $content
#> [1] "cmVsZWFzZSxpZGVudGl0eQoyMDI0MDMyNixQUk9ECjIwMjQxMTAxLFBST0QK\nMjAyNDExMDUsUFJPRAoyMDI1MDIwMyxURVNUCg==\n"
#> 
#> $encoding
#> [1] "base64"
#> 
#> $`_links`
#> $`_links`$self
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/contents/releases.csv?ref=releases"
#> 
#> $`_links`$git
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/git/blobs/6aeea0afa8ed6a92dc0e3455e73ae06c1bbce376"
#> 
#> $`_links`$html
#> [1] "https://github.com/PIP-Technical-Team/pip_info/blob/releases/releases.csv"
#> 
#> 
#> $owner
#> [1] "PIP-Technical-Team"
#> 
#> $repo
#> [1] "pip_info"
#> 
#> $branch
#> [1] "releases"
#>