Github action to print relevant stats about Pull Request reviewers.
The objective of this action is to:
Running this action will add a section at the bottom of your pull requests description:
Each reviewer has a link pointing to their historical behavior)) of each reviewer:
Or send the data to your favorite tools by using the integrations available:
Slack |
MS Teams |
Webhooks |
---|
telemetry
option.Just add this action to one of your workflow files:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@master
If you are getting an empty table or an error, check the troubleshooting section.
The possible inputs for this action are:
Parameter | Description | Default |
---|---|---|
token |
A Personal Access Token with repo permissions. Required to calculate stats for an organization or multiple repos. |
GITHUB_TOKEN |
repositories |
A comma-separated list of GitHub repositories to calculate the stats, e.g. username/repo1,username/repo2 . When specifying other repo(s), it is mandatory to pass a Personal Access Token in the token parameter. |
Current repository |
organization |
If you prefer, you may specify your organization's name to calculate the stats across all of its repos. When specifying an organization, it is mandatory to pass a Personal Access Token in the token parameter. |
null |
period |
The period used to calculate the stats, expressed in days. | 30 |
limit |
The maximum number of rows to display in the table. A value of 0 means unlimited. |
0 |
charts |
Whether to add a chart to the start. Possible values: true or false . |
false |
disableLinks |
If true , removes the links to the detailed charts. Possible values: true or false . |
false |
sortBy |
The column used to sort the data. Possible values: REVIEWS , TIME , COMMENTS . |
REVIEWS |
publishAs |
Where to publish the results. Possible values: as a COMMENT , on the pull request DESCRIPTION , or publish NONE . |
COMMENT |
exclude |
A comma-separated list of usernames (case-insensitive) to be excluded from the results (e.g. username1,username2 ), or a regular expression enclosed between slashes (eg. /^bot/i will exclude all usernames that begin with "bot"). |
null |
telemetry |
Indicates if the action is allowed to send monitoring data to the developer. This data is minimal and helps me improve this action. This option is a premium feature reserved for sponsors. | true |
slackWebhook |
🔥 New. A Slack webhook URL to post resulting stats. This option is a premium feature reserved for sponsors. See full documentation here. | null |
slackChannel |
The Slack channel where stats will be posted. Include the # character (eg. #mychannel ). Required when a slackWebhook is configured. |
null |
teamsWebhook |
🔥 New. A Microsoft Teams webhook URL to post resulting stats. This option is a premium feature reserved for sponsors. See full documentation here. | null |
webhook |
🔥 New. A webhook URL to send the resulting stats as JSON (integrate with Zapier, IFTTT...). See full documentation here. | null |
This action outputs the following variables:
Variable | Description |
---|---|
resultsMd |
The resulting stats stored as a step output variable in Markdown format. |
resultsJson |
The resulting stats stored as a step output variable in JSON format. |
Minimal config
Add this to the file .github/workflows/stats.yml
in your repo:
name: Pull Request Stats
on:
pull_request:
types: [opened]
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@master
This config will:
and print a table like this:
User | Total reviews | Median time to review | Total comments | |
---|---|---|---|---|
jartmez | 37 | 22m)) | 13 | |
manuelmhtr | 35 | 48m)) | 96 | |
ernestognw | 25 | 1h 27m)) | 63 | |
javierbyte | 12 | 30m)) | 0 | |
Phaze1D | 4 | 34m)) | 1 |
Visual config
Add this to the file .github/workflows/stats.yml
:
name: Pull Request Stats
on:
pull_request:
types: [opened]
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@master
with:
token: ${{ secrets.ADD_A_PERSONAL_ACCESS_TOKEN }}
organization: 'piedpiper'
period: 7
charts: true
disableLinks: true
sortBy: 'COMMENTS'
This config will:
and print a table like this:
The stats are calculated as follows:
Check the guide for the tool you want to integrate:
This action offers some premium features only for sponsors:
The suggested sponsorship is $20 USD / month. However, if it's not possible for you or your organization, please consider supporting it with any amount you can. Even a one-time sponsorship will enable the Premium features and encourage the progress of this project.
Being a sponsor will also give you access to the premium features in all of my other projects.
Thanks for your support! 💙
Used by hundreds of successful teams:
Sixt |
Lululemon |
Delivery H |
JOKR |
Lego |
LOOP |
Hatch |
Zenfi |
---|---|---|---|---|---|---|---|
Intel |
Auth0 |
Addition |
Fauna |
CDC |
Wecasa |
Bolt |
Republic |
@manuelmhtr 🇲🇽 Guadalajara, MX |
|
---|---|
@CarlosCRG19 🇲🇽 Colima, MX |
This project is maintained by a small team, considering supporting the project by:
Breaking News! We’ve unleashed the stand-alone version of this action!
MIT