Github action to print relevant stats about Pull Request reviewers.
The objective of this action is to:
- Reduce the time taken to review the pull requests.
- Encourage quality on reviews.
- Help deciding which people to assign as reviewers.
Running this action will create a comment like this, visible in your pull requests:
🌟 New in v1.1: The "average time to review" metric includes a link to see the historical behavior of each user.
Just add this action to one of your workflow files:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@v1
The possible inputs for this action are:
Parameter | Description | Default |
---|---|---|
token |
GITHUB_TOKEN or a Personal Access Token with "repo" permission. |
GITHUB_TOKEN |
repositories |
A comma separated list of github repositories to calculate the stats. When specifying other repo(s) it is mandatory to pass a Personal Access Token in the token parameter. |
Current repository |
period |
The length of the period used to calculate the stats, expressed in days. | 30 |
charts |
Whether to add a chart to the start or not. Possible values: true or false . |
false |
disable-links |
If enabled, removes the links to the detailed charts. Possible values: true or false . |
false |
sort-by |
The column used to sort the data. Possible values: TIME , COMMENTS , REVIEWS . |
TIME |
Minimal config
Add this to the file .github/workflows/stats.yml
:
name: Pull Request Stats
on: pull_request
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@v1
This will print a table like this:
User | Avg. time to first review | Total pull reviews | Total comments | |
---|---|---|---|---|
noelrock333 | 34m | 11 | 1 | |
Salomon21 | 1h 10m | 1 | 0 | |
manuelmhtr | 1h 21m | 33 | 43 | |
LXLH | 1h 41m | 18 | 4 | |
Phaze1D | 3h 11m | 6 | 0 |
Visual config
Add this to the file .github/workflows/stats.yml
:
name: Pull Request Stats
on: pull_request
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@v1
with:
token: ${{ secrets.ADD_A_PERSONAL_ACCESS_TOKEN }}
repositories: 'username/repo1,username/repo2,username/repo3'
period: 7
charts: true
sort-by: 'COMMENTS'
This config will:
- Calculate the reviewer stats for the 3 repos in the lasts 7 days
- Display charts for the metrics
- Sort results by the "comments" column
And print a table like this:
AGPLv3