Skip to content

Commit bd4bd84

Browse files
Added KB article to GitHub Stats repo
Added a link to the companion KB article for the GitHub Usage Stats repo with detailed documentation. Removed documentation from README.
1 parent aef8991 commit bd4bd84

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,26 @@ Scripts to capture GitHub repository and usage statistics daily, for all reposit
99

1010

1111
## 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.
2016

2117

2218

2319
## Documentation
2420

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
2625
+ The statistics will be dumped into both CSV and JSON files in the output directory, including:
2726
+ **github-stats-{OrganizationName}.csv** - today's snapshot in CSV format. File is replaced at each run. Recommended for loading into a database.
2827
+ **github-stats-{OrganizationName}.json** - today's snapshot in JSON format. File is replaced at each run. Recommended for loading into a database.
2928
+ **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.
3029
+ **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.
3130
+ 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.
3332

3433
### Loading Into a Database
3534
+ 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
4342

4443

4544
## 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.
4848

4949

5050

@@ -69,7 +69,8 @@ If you need assistance identifying a contact person, email the EFDC's Mobile Tec
6969

7070

7171
#### 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.
73+
+ GitHUB's [API](https://docs.github.com/en/rest/metrics/traffic).
7374

7475

7576
## License

0 commit comments

Comments
 (0)