Skip to content

Commit ca7cf3b

Browse files
committed
Use wio to obtain installations and take screenshots.
https://github.com/workflowr/wio
1 parent a364cb0 commit ca7cf3b

File tree

43 files changed

+30
-310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+30
-310
lines changed

bin/update-github.R

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env Rscript
22

3+
# Requires GH_APP_ID and GH_APP_KEY for GitHub App workflowr.io
4+
#
5+
# https://github.com/workflowr/wio
6+
# https://docs.github.com/en/free-pro-team@latest/rest/reference/apps#list-installations-for-the-authenticated-app
37
# https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-a-repository
48
# https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-all-repository-topics
59
# https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-a-github-pages-site
@@ -8,40 +12,16 @@
812

913
suppressMessages({
1014
requireNamespace("gh")
15+
requireNamespace("wio")
1116
requireNamespace("yaml")
1217
})
1318

14-
account <- gh::gh_whoami()
15-
if (is.null(account)) {
16-
stop("No GitHub access token could be found", call. = FALSE)
17-
}
18-
message(sprintf("Using the GitHub account '%s'", account$login))
19-
rate <- gh::gh("/rate_limit")
20-
message(sprintf("Remaining API requests: %d", rate$rate$remaining))
21-
if (rate$rate$remaining < 100) {
22-
stop("Insufficient remaining API requests available", call. = FALSE)
23-
}
24-
2519
# Obtain projects -------------------------------------------------------------
2620

27-
# To do: Download list of GitHub repositories that have GitHub App installed
28-
29-
users <- c("jdblischak", "pcarbo", "stephens999", "stephenslab")
30-
results <- list()
31-
for (user in users) {
32-
query <- sprintf("filename%%3A_workflowr.yml+user%%3A%s&per_page=100", user)
33-
search <- gh::gh(paste0("/search/code?q=", query))
34-
results <- c(results, search$items)
35-
}
36-
37-
projects <- vector(mode = "list", length = length(results))
38-
for (i in seq_along(results)) {
39-
projects[[i]] <- list(owner = results[[i]]$repository$owner$login,
40-
repo = results[[i]]$repository$name)
41-
}
21+
projects <- wio::getProjectsOnGitHub()
4222

43-
# Remove the workflowr repository itself. It contains _workflowr.yml in the
44-
# tests directory
23+
# Remove any forks of the workflowr repository itself. It contains
24+
# _workflowr.yml in the tests directory.
4525
projects <- Filter(function(x) x[["repo"]] != "workflowr", projects)
4626

4727
# Gather project information --------------------------------------------------
@@ -136,3 +116,4 @@ createThumbnailPath <- function(x) {
136116
file.path(dirContent, "github", x$account, x$title, "thumbnail.png")
137117
}
138118
thumbnails <- vapply(output, createThumbnailPath, character(1))
119+
wio::screenshot(websites, thumbnails)

content/projects/github/jdblischak/bootcamp/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/dc-bioc-limma/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/live-demo/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/myproject/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions

content/projects/github/jdblischak/wflow-darkly/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/wflow-datos-de-miercoles/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/jdblischak/wflow-r4ds/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/wflow-rs-cloud/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/jdblischak/wflow-tidy-tuesday/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/jdblischak/workflowr-spotify/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/pcarbo/myproject/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/pcarbo/research-workflowr-template/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/pcarbo/workflowr-spotify-2/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/pcarbo/workflowr-spotify/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions

content/projects/github/stephens999/misc/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephens999/myproject/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephens999/poisson/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/stephens999/stat34800/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephens999/susier-investigate/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephens999/test_bootcamp/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephenslab/dsc-linreg/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephenslab/dsc-log-fold-change/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/stephenslab/mash-single-cell-rnaseq/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/stephenslab/mr-ash-workflow/index.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/projects/github/stephenslab/reading_lists/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

content/projects/github/stephenslab/rss/index.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

content/projects/github/stephenslab/test/index.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)