Display news and upgrade outdated GitHub R packages
Get a similar output as the RStudio Update button for CRAN packages, but for GitHub ones.
You can install the released version of upnews from github
if (!requireNamespace("remotes")) install.packages("remotes")
remotes::install_github("ginolhac/upnews")
if (!requireNamespace("remotes")) install.packages("remotes")
remotes::install_github("ginolhac/upnews", dependencies = TRUE)
This add-in will fetch the remote HEAD sha1
of local github packages and compare them, to the remote HEAD
(same branch).
If some packages are outdated, fetch and display a link to a NEWS file (case insensitive NEWS.md
).
If the Ref
is a commit, all branches are tested to find out from which branch it originate from.
> upnews::upnews()
fetching 23 distant sha1
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 05s
4 outdated pkgs (23 gh pkgs)
fetching news...
no news for jeroen/credentials/master
# A tibble: 4 x 7
pkgs loc_version gh_version local remote date news
* <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 ginolhac/bifag 0.1.3.990 0.1.3.990 master@d490355 master@362992a 2018-11-07 https://raw.githubusercontent.com/ginolhac/bifag/master/NEWS.md
2 jeroen/credentials 0.1 0.1 master@c9a4197 master@e1b2d9d 2018-11-13 NA
3 r-lib/pkgbuild 1.0.2.9000 1.0.2.9000 master@aec4654 master@6e4ebdf 2018-10-28 https://raw.githubusercontent.com/r-lib/pkgbuild/master/NEWS.md
4 tidyverse/rlang 0.3.0.9000 0.3.0.9000 master@f6a719a master@b8566db 2018-11-14 https://raw.githubusercontent.com/r-lib/rlang/master/NEWS.md
HEAD
DataTable
output is displayed:user/pkg
and a link to the GitHub repoDESCRIPTION
local file, and a pophover text displays branch/commit
DESCRIPTION
remote file, and a pophover text displays branch/commit
when the green buttons are used, NEWS.md
are fetched and rendered in modals:
If you need more request to the GitHub API, you must be authenticated. Then, the limit is 5,000 requests per hour instead of 60.
To authenticate yourself, you can follow the great happygitwithr bookdown by Jenny Bryan. The specific chapter about the GITHUB_PAT
env variable is here. Brefly:
~/.Renviron
fileSys.getenv("GITHUB_PAT")
@Pakillo recently made me aware of this similar package dtupdate by Bob Rudis. It has no add-in plus a dependency to dplyr
but must be more stable than this one.
shinytest
)remotes
v2.0.1 allows an interactive upgrade?