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
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,27 +9,26 @@ Scripts to capture GitHub repository and usage statistics daily, for all reposit
9
9
10
10
11
11
## Quick Start Guide
12
-
+ Get a GitHub API key with read permissions to your organization.
13
-
+ Set GITHUB_USERNAME and GITHUB_API_KEY in the system environment variables
14
-
+ Install the PowerShellForGitHub module in PowerShell.
15
-
+ Download the PowerShell script (ExportGitHubUsageStatsForOrganization.ps1).
16
-
+ Edit the settings at the top of the script, including the Organization Name variable.
17
-
+ Create a directory for the output files, c:\GitHubStats, or as configured in previous step.
18
-
+ Run the script in PowerShell.
19
-
+ Grab the CSV or JSON files from the output directory. Files are replaced except for the "rolling" file which appends to previous days' data.
12
+
+ Set GITHUB_USERNAME and GITHUB_API_KEY in the system environment variables.
13
+
+ Download the PowerShell script (ExportGitHubUsageStatsForOrganization.ps1). In addition, install the PowerShellForGitHub module.
14
+
+ Edit the settings at the top of the script, and run it.
15
+
+ Grab the CSV or JSON files from the output directory. Files are replaced at each run, except for the "rolling" file which appends to previous days' data.
20
16
21
17
22
18
23
19
## Documentation
24
20
25
-
### General Information
21
+
### Detailed Instructions
22
+
+ Detailed setup and use instructions are available in the companion knowledge base article, [Gathering GitHub Usage and Web Traffic Data](https://teamdynamix.umich.edu/TDClient/210/DepressionCenter/KB/ArticleDet?ID=12311).
23
+
24
+
### General Notes
26
25
+ The statistics will be dumped into both CSV and JSON files in the output directory, including:
27
26
+**github-stats-{OrganizationName}.csv** - today's snapshot in CSV format. File is replaced at each run. Recommended for loading into a database.
28
27
+**github-stats-{OrganizationName}.json** - today's snapshot in JSON format. File is replaced at each run. Recommended for loading into a database.
29
28
+**github-stats-detailed-{OrganizationName}.json** - today's snapshot in JSON format, with all detailed included. File is replaced at each run. It can be used for debugging and troubleshooting.
30
29
+**github-stats-rolling-{OrganizationName}.csv** - today's snapshot added to the same CSV, without deleting previous data. This file can be used to create reports directly in Excel, Tableau, PowerBI, etc. without the need for a database.
31
30
+ All the counts not labeled "yesterday" are 14-day totals, not for an individual day.
32
-
+ Note that all dates and times are in universal time (UTC), in the GMT time zone.
31
+
+ Note that all dates and times are in universal time (UTC), in the GMT time zone (+00:00). That's because GitHub uses GMT to mark a "day" - the most granular time period available - and by keeping things in GMT, reporting becomes easier.
33
32
34
33
### Loading Into a Database
35
34
+ The script(s) under the SQL folder can be used to create a table to host and accumulate the data. It includes SQL comments for most columns to use in a data dictionary.
@@ -43,8 +42,9 @@ Scripts to capture GitHub repository and usage statistics daily, for all reposit
43
42
44
43
45
44
## Additional Resources
46
-
+[GitHub API Documentation](https://docs.github.com/en/rest/metrics?apiVersion=2022-11-28)
47
-
+[Microsoft's PowerShell wrapper](https://github.com/microsoft/PowerShellForGitHub) for the GitHub API
45
+
+ Companion knowledge base article: [Gathering GitHub Usage and Web Traffic Data](https://teamdynamix.umich.edu/TDClient/210/DepressionCenter/KB/ArticleDet?ID=12311)..
46
+
+[GitHub API Documentation](https://docs.github.com/en/rest/metrics?apiVersion=2022-11-28).
47
+
+[Microsoft's PowerShell wrapper](https://github.com/microsoft/PowerShellForGitHub) for the GitHub API.
48
48
49
49
50
50
@@ -69,7 +69,8 @@ If you need assistance identifying a contact person, email the EFDC's Mobile Tec
69
69
70
70
71
71
#### This work is based in part on the following projects, libraries and/or studies:
72
-
+ Microsoft's [PowerShellForGitHub](https://github.com/microsoft/PowerShellForGitHub) module for PowerShell
72
+
+ Microsoft's [PowerShellForGitHub](https://github.com/microsoft/PowerShellForGitHub) module for PowerShell.
0 commit comments