Get info of a branch in a GitHub repo
get_branch_info_from_gh.Rd
Get info of a branch in a GitHub repo
Arguments
- owner
character: owner of repo
- repo
character: repository name
- branch
character: branch name (default is "main")
- gh_func
function: function used to call the GitHub API (default is
gh::gh
)- creds_func
function: function used to retrieve GitHub credentials (default is
get_github_creds
)- url_func
function: function used to extract additional information from the protection URL (default is
info_from_url
)
Examples
get_branch_info_from_gh(owner = getOption("pipfun.ghowner"),
repo = "pip_info",
branch = "releases")
#> Git credentials are missing or invalid in non-interactive mode.
#> $name
#> [1] "releases"
#>
#> $commit
#> $commit$sha
#> [1] "d57c7af0aa2e9508051f80636a2f620ef5868226"
#>
#> $commit$node_id
#> [1] "C_kwDOMtdcOdoAKGQ1N2M3YWYwYWEyZTk1MDgwNTFmODA2MzZhMmY2MjBlZjU4NjgyMjY"
#>
#> $commit$commit
#> $commit$commit$author
#> $commit$commit$author$name
#> [1] "Diana Garcia"
#>
#> $commit$commit$author$email
#> [1] "76685138+dana89co@users.noreply.github.com"
#>
#> $commit$commit$author$date
#> [1] "2025-07-25T15:01:08Z"
#>
#>
#> $commit$commit$committer
#> $commit$commit$committer$name
#> [1] "Diana Garcia"
#>
#> $commit$commit$committer$email
#> [1] "76685138+dana89co@users.noreply.github.com"
#>
#> $commit$commit$committer$date
#> [1] "2025-07-25T15:01:08Z"
#>
#>
#> $commit$commit$message
#> [1] "Updating data via R script on 2025-07-25 11:01:08.136239"
#>
#> $commit$commit$tree
#> $commit$commit$tree$sha
#> [1] "0c65df8688d8b9ce895f130e5a90944e3b1f9956"
#>
#> $commit$commit$tree$url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/git/trees/0c65df8688d8b9ce895f130e5a90944e3b1f9956"
#>
#>
#> $commit$commit$url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/git/commits/d57c7af0aa2e9508051f80636a2f620ef5868226"
#>
#> $commit$commit$comment_count
#> [1] 0
#>
#> $commit$commit$verification
#> $commit$commit$verification$verified
#> [1] FALSE
#>
#> $commit$commit$verification$reason
#> [1] "unsigned"
#>
#> $commit$commit$verification$signature
#> NULL
#>
#> $commit$commit$verification$payload
#> NULL
#>
#> $commit$commit$verification$verified_at
#> NULL
#>
#>
#>
#> $commit$url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/commits/d57c7af0aa2e9508051f80636a2f620ef5868226"
#>
#> $commit$html_url
#> [1] "https://github.com/PIP-Technical-Team/pip_info/commit/d57c7af0aa2e9508051f80636a2f620ef5868226"
#>
#> $commit$comments_url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/commits/d57c7af0aa2e9508051f80636a2f620ef5868226/comments"
#>
#> $commit$author
#> $commit$author$login
#> [1] "dana89co"
#>
#> $commit$author$id
#> [1] 76685138
#>
#> $commit$author$node_id
#> [1] "MDQ6VXNlcjc2Njg1MTM4"
#>
#> $commit$author$avatar_url
#> [1] "https://avatars.githubusercontent.com/u/76685138?v=4"
#>
#> $commit$author$gravatar_id
#> [1] ""
#>
#> $commit$author$url
#> [1] "https://api.github.com/users/dana89co"
#>
#> $commit$author$html_url
#> [1] "https://github.com/dana89co"
#>
#> $commit$author$followers_url
#> [1] "https://api.github.com/users/dana89co/followers"
#>
#> $commit$author$following_url
#> [1] "https://api.github.com/users/dana89co/following{/other_user}"
#>
#> $commit$author$gists_url
#> [1] "https://api.github.com/users/dana89co/gists{/gist_id}"
#>
#> $commit$author$starred_url
#> [1] "https://api.github.com/users/dana89co/starred{/owner}{/repo}"
#>
#> $commit$author$subscriptions_url
#> [1] "https://api.github.com/users/dana89co/subscriptions"
#>
#> $commit$author$organizations_url
#> [1] "https://api.github.com/users/dana89co/orgs"
#>
#> $commit$author$repos_url
#> [1] "https://api.github.com/users/dana89co/repos"
#>
#> $commit$author$events_url
#> [1] "https://api.github.com/users/dana89co/events{/privacy}"
#>
#> $commit$author$received_events_url
#> [1] "https://api.github.com/users/dana89co/received_events"
#>
#> $commit$author$type
#> [1] "User"
#>
#> $commit$author$user_view_type
#> [1] "public"
#>
#> $commit$author$site_admin
#> [1] FALSE
#>
#>
#> $commit$committer
#> $commit$committer$login
#> [1] "dana89co"
#>
#> $commit$committer$id
#> [1] 76685138
#>
#> $commit$committer$node_id
#> [1] "MDQ6VXNlcjc2Njg1MTM4"
#>
#> $commit$committer$avatar_url
#> [1] "https://avatars.githubusercontent.com/u/76685138?v=4"
#>
#> $commit$committer$gravatar_id
#> [1] ""
#>
#> $commit$committer$url
#> [1] "https://api.github.com/users/dana89co"
#>
#> $commit$committer$html_url
#> [1] "https://github.com/dana89co"
#>
#> $commit$committer$followers_url
#> [1] "https://api.github.com/users/dana89co/followers"
#>
#> $commit$committer$following_url
#> [1] "https://api.github.com/users/dana89co/following{/other_user}"
#>
#> $commit$committer$gists_url
#> [1] "https://api.github.com/users/dana89co/gists{/gist_id}"
#>
#> $commit$committer$starred_url
#> [1] "https://api.github.com/users/dana89co/starred{/owner}{/repo}"
#>
#> $commit$committer$subscriptions_url
#> [1] "https://api.github.com/users/dana89co/subscriptions"
#>
#> $commit$committer$organizations_url
#> [1] "https://api.github.com/users/dana89co/orgs"
#>
#> $commit$committer$repos_url
#> [1] "https://api.github.com/users/dana89co/repos"
#>
#> $commit$committer$events_url
#> [1] "https://api.github.com/users/dana89co/events{/privacy}"
#>
#> $commit$committer$received_events_url
#> [1] "https://api.github.com/users/dana89co/received_events"
#>
#> $commit$committer$type
#> [1] "User"
#>
#> $commit$committer$user_view_type
#> [1] "public"
#>
#> $commit$committer$site_admin
#> [1] FALSE
#>
#>
#> $commit$parents
#> $commit$parents[[1]]
#> $commit$parents[[1]]$sha
#> [1] "fed245010c4431fee9fc9c6d24e52aa7a58f522b"
#>
#> $commit$parents[[1]]$url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/commits/fed245010c4431fee9fc9c6d24e52aa7a58f522b"
#>
#> $commit$parents[[1]]$html_url
#> [1] "https://github.com/PIP-Technical-Team/pip_info/commit/fed245010c4431fee9fc9c6d24e52aa7a58f522b"
#>
#>
#>
#>
#> $`_links`
#> $`_links`$self
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/branches/releases"
#>
#> $`_links`$html
#> [1] "https://github.com/PIP-Technical-Team/pip_info/tree/releases"
#>
#>
#> $protected
#> [1] FALSE
#>
#> $protection
#> $protection$enabled
#> [1] FALSE
#>
#> $protection$required_status_checks
#> $protection$required_status_checks$enforcement_level
#> [1] "off"
#>
#> $protection$required_status_checks$contexts
#> list()
#>
#> $protection$required_status_checks$checks
#> list()
#>
#>
#>
#> $protection_url
#> [1] "https://api.github.com/repos/PIP-Technical-Team/pip_info/branches/releases/protection"
#>
#> $owner
#> [1] "PIP-Technical-Team"
#>
#> $repo
#> [1] "pip_info"
#>
#> $branch
#> [1] "releases"
#>