You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,41 @@
1
1

2
2
3
-
# <RepositoryTitle>
3
+
# GitHub Usage Stats
4
4
5
5
## Description
6
-
This is the code repository for <program/library name>, a <program/library> for (description of what it does).
6
+
Scripts to capture GitHub repository and usage statistics daily. It is designed to get statistics for all repos under a GitHub Enterprise-licensed organization, but it should also work for personal repositories.
7
+
The PowerShell script was moved here from its previous location at: [https://github.com/DepressionCenter/MTC-Internal-Tools-and-Automation.](https://github.com/DepressionCenter/MTC-Internal-Tools-and-Automation/blob/main/PowerShell%20Scripts/ExportGitHubUsageStatsForOrganization.ps1)
7
8
8
9
9
10
10
11
## Quick Start Guide
11
-
<Quick compile/run instructions>
12
+
+ Get an API key from the Organization you want to use (with read permissions). This must be done by an admin of the organization. If running this for personal repos, get an API key from yur own account
13
+
+ Install the PowerShellForGitHub module in PowerShell for the system, or for the user who will run the script
14
+
+ Download the PowerShell script (ExportGitHubUsageStatsForOrganization.ps1)
15
+
+ Edit the settings at the top of the script, including the Organization Name variable
16
+
+ Create a directory for the output files, c:\GitHubStats, or as configured in previous step
17
+
+ Run the script in PowerShell
18
+
+ Grab the CSV or JSON files from the output directory. Files are replaced except for the "rolling" file which appends to previous days' data.
19
+
+ Optional step: Use Windows Scheduler to run the script daily, and make the output directory a file share with appropriate permissions.
12
20
13
21
14
22
15
23
## Documentation
16
-
<Links to manual, wiki, full documentation, etc.>
24
+
+ The statistics will be dumped into both CSV and JSON files in the output directory, including:
25
+
+**{efdc}-github-stats.csv** - today's snapshot in CSV format; web traffic goes back 14 days. File is replaced at each run.
26
+
+**{efdc}-github-stats.json** - today's snapshot in JSON format; web traffic goes back 14 days. File is replaced at each run.
27
+
+**{efdc}-github-stats-rolling.csv** - stoday's snapshot added to the same CSV, without deleting previous data.
28
+
+ All the counts are 14-day totals, not for an individual day.
17
29
18
30
19
31
## Additional Resources
20
-
<Links to study website, related projects, etc.>
32
+
+[GitHub API Documentation](https://docs.github.com/en/rest/metrics?apiVersion=2022-11-28)
33
+
+[Microsoft's PowerShell wrapper](https://github.com/microsoft/PowerShellForGitHub) for the GitHub API
21
34
22
35
23
36
24
37
## About the Team
25
-
< 1-2 paragraphs about your core, study team, class or project. >
38
+
The Mobile Technologies Core provides investigators across the University of Michigan the support and guidance needed to utilize mobile technologies and digital mental health measures in their studies. Experienced faculty and staff offer hands-on consultative services to researchers throughout the University – regardless of specialty or research focus.
26
39
27
40
28
41
@@ -37,12 +50,12 @@ If you need assistance identifying a contact person, email the EFDC's Mobile Tec
37
50
#### Contributors:
38
51
+ Eisenberg Family Depression Center [(@DepressionCenter)](https://github.com/DepressionCenter/)
39
52
+ Gabriel Mongefranco [(@gabrielmongefranco)](https://github.com/gabrielmongefranco)
53
+
+ Special thanks to the U-M "HITS Academic Integrations" team and Joe Lipa for creating a data pipeline to load this script into a database.
40
54
41
55
42
56
43
57
#### This work is based in part on the following projects, libraries and/or studies:
44
-
+ None
45
-
58
+
+ Microsoft's [PowerShellForGitHub](https://github.com/microsoft/PowerShellForGitHub) module for PowerShell
0 commit comments