-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 2.65 KB
/
write-data.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Writing GitHub Metrics to Googlesheet
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
jobs:
write-data:
name: Write Data
runs-on: ubuntu-latest
container:
image: cansav09/metricminer
steps:
- name: Authorize metricminer
env:
METRICMINER_GITHUB_PAT: ${{ secrets.METRICMINER_GITHUB_PAT }}
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: |
library(magrittr)
# Authorize GitHub
metricminer::auth_from_secret("github", token = Sys.getenv("METRICMINER_GITHUB_PAT"))
# Authorize Google
metricminer::auth_from_secret("google",
refresh_token = Sys.getenv("METRICMINER_GOOGLE_REFRESH"),
access_token = Sys.getenv("METRICMINER_GOOGLE_ACCESS"),
cache = TRUE
)
gsheet <- "https://docs.google.com/spreadsheets/d/1lk3vMgE4CNuACrI1mzHrv6AsvXbdhw1zJENMkIEhrZs/edit#gid=0"
repos <- c(
"fhdsl/metricminer",
"fhdsl/metricminer.org",
"jhudsl/ottrpal",
"jhudsl/ari",
"jhudsl/cow",
"jhudsl/ottrproject.org",
"jhudsl/ottr_docker",
"jhudsl/ottr-reports",
"fhdsl/conrad",
"jhudsl/text2speech",
"jhudsl/OTTR_Quizzes",
"jhudsl/OTTR_Template",
"jhudsl/OTTR_Template_Website",
"jhudsl/ITCR_Tables",
"jhudsl/ITN_Platforms",
"fhdsl/Choosing_Genomics_Tools",
"jhudsl/Informatics_Research_Leadership",
"jhudsl/Documentation_and_Usability",
"jhudsl/Reproducibility_in_Cancer_Informatics",
"jhudsl/Adv_Reproducibility_in_Cancer_Informatics",
"fhdsl/GitHub_Automation_for_Scientists",
"jhudsl/Computing_for_Cancer_Informatics",
"fhdsl/Overleaf_and_LaTeX_for_Scientific_Articles",
"fhdsl/Ethical_Data_Handling_for_Cancer_Research",
"fhdsl/AI_for_Decision_Makers",
"fhdsl/AI_for_Efficient_Programming",
"fhdsl/NIH_Data_Sharing"
)
repo_metrics <- metricminer::get_multiple_repos_metrics(repo_names = repos, time_course = TRUE)
combine_data <- googlesheets4::read_sheet(gsheet) %>%
dplyr::bind_rows(repo_metrics) %>%
dplyr::distinct()
datasheet <- metricminer::write_to_gsheet(gsheet = gsheet,
input = combine_data,
overwrite = TRUE)
shell: Rscript {0}