Skip to content

Instantly share code, notes, and snippets.

@hrbrmstr
Created June 7, 2018 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrbrmstr/725342cf2bcb83a03427df3cd0e8ad53 to your computer and use it in GitHub Desktop.
Save hrbrmstr/725342cf2bcb83a03427df3cd0e8ad53 to your computer and use it in GitHub Desktop.
mkpub <- function(who = "hrbrmstr", prj_name) {
httr::PUT(
url = sprintf("https://gitlab.com/api/v4/projects/%s%%2F%s", who, prj_name),
query = list(
visibility = "public",
private_token = Sys.getenv("GITLAB_PAT")
)
) -> res
httr::content(res, as="parsed")
}
lsprj <- function(who = "hrbrmstr", pg = 1) {
httr::GET(
url = sprintf("https://gitlab.com/api/v4/users/%s/projects", who),
query = list(
visibility = "private",
private_token = Sys.getenv("GITLAB_PAT"),
per_page = 100,
page = pg
)
) -> res
httr::content(res, as="parsed")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment