Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asottile/gh-perf-review
hackety tool to view github PRs for a period
https://github.com/asottile/gh-perf-review
Last synced: 13 days ago
JSON representation
hackety tool to view github PRs for a period
- Host: GitHub
- URL: https://github.com/asottile/gh-perf-review
- Owner: asottile
- Created: 2019-01-13T20:00:15.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T00:30:48.000Z (22 days ago)
- Last Synced: 2024-10-22T21:30:12.768Z (22 days ago)
- Language: Python
- Size: 203 KB
- Stars: 81
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/gh-perf-review/main.svg)](https://results.pre-commit.ci/latest/github/asottile/gh-perf-review/main)
gh-perf-review
==============hackety tool to view github PRs for a period
## setting up a token
1. Create a gh token on [the settings tab](//github.com/settings/tokens/new)
- use `repo` scope if you need private repos, otherwise `public_repo`
- if your org is protected by SSO, make sure to enable that for the token by clicking the Authorize button within the Enable SSO dropdown
1. Write out the settings file needed for this script```bash
echo '{"token": "TOKEN HERE"}' > .github-auth.json
chmod 600 .github-auth.json
"${EDITOR:-vim}" .github-auth.json
```## generating markdown output
Usage: `python3 gh_perf_review.py ORG YEAR PERIOD [--user USER] [--involves INVOLVES]`
- `ORG`: the github organization to search in
- `YEAR`: the four digit year to search in
- `PERIOD`: the time period to search in, currently supported: Q1, Q2, Q3, Q4,
H1, H2, Y
- `--api-root API_ROOT`: optional, will use https://api.github.com by default
- `--user USER`: optional, will use the authenticated user otherwise
- `--involves INVOLVES`: optional, will filter for reviews involving this reviewerThe script writes its output to stdout, if you'd like to capture that, redirect
it to a file:```bash
python3 gh_perf_review.py pre-commit 2018 Q4 > report.md
```If you'd like to convert it to html, one such tool is
[markdown-code-blocks](https://github.com/asottile/markdown-code-blocks).```bash
python3 gh_perf_review.py pre-commit 2018 Q4 |
markdown-code-blocks-highlight /dev/stdin |
sed 's||td, th { padding: 5px; border: 1px solid #000; }|g' > report.htm
```## sample output
[pre-commit 2018 Y](example.md)