Skip to content

Commit 2b38d47

Browse files
Update README.md
Initial README commit.
1 parent 0c7bab5 commit 2b38d47

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
![Depression Center Logo](https://github.com/DepressionCenter/.github/blob/main/images/EFDCLogo_375w.png "depressioncenter.org")
22

3-
# <Repository Title>
3+
# GitHub Usage Stats
44

55
## 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)
78

89

910

1011
## 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.
1220

1321

1422

1523
## 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.
1729

1830

1931
## 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
2134

2235

2336

2437
## 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.
2639

2740

2841

@@ -37,12 +50,12 @@ If you need assistance identifying a contact person, email the EFDC's Mobile Tec
3750
#### Contributors:
3851
+ Eisenberg Family Depression Center [(@DepressionCenter)](https://github.com/DepressionCenter/)
3952
+ 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.
4054

4155

4256

4357
#### 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
4659

4760

4861
## License

0 commit comments

Comments
 (0)