Skip to content

Commit

Permalink
Add support and docs for local running
Browse files Browse the repository at this point in the history
  • Loading branch information
wumphlett committed Aug 27, 2022
1 parent 11cdb7c commit d2c5bc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TRAFFIC_ACTION_TOKEN=ghp_***
GITHUB_REPOSITORY=<username>/<repo>
GITHUB_WORKSPACE=.
TRAFFIC_DIR=.traffic
13 changes: 13 additions & 0 deletions .github/TEMPLATE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ daily.
4. Trigger the action to format your readme which will automatically commit the changes
1. Note, all changes that you want to make to your readme must now be made to the template instead of the readme in the root of the repo
## Running `github-repo-traffic` locally
You can use the package responsible for metric collection/aggregation locally instead of in a github action.
1. `pip install github-repo-stats`
2. Set the environment variables in `.env.example`
1. TRAFFIC_ACTION_TOKEN - a personal access token with repo permissions
2. GITHUB_REPOSITORY - the repo you're trying to collect metrics for (e.g. wumphlett/repostats)
3. GITHUB_WORKSPACE - your root directory (can be anything if you're not using readme formatting, else root of a repo)
4. TRAFFIC_DIR - the directory to store collected metrics (default `.traffic`)
3. Invoke the commands
1. `repo-data` - collects and aggregates metric data (make sure to run at least every two weeks for complete data)
2. `repo-readme` - formats a template readme with a views/clones chart
```
{VIEWS_CHART}
```

0 comments on commit d2c5bc8

Please sign in to comment.