Skip to content

Commit

Permalink
v2.4.0: Publish stats as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmhtr committed Jun 18, 2022
1 parent f74b6cd commit 507103c
Show file tree
Hide file tree
Showing 22 changed files with 417 additions and 194 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## [2.4.0] - 2022-06-18
### Added
- [#24](https://github.com/flowwer-dev/pull-request-stats/issues/24) Adds option `publish-as` to publish the resulting stats in the Pull Request description or as a comment.

### Changed
- Switching default publication strategy to `COMMENT`.

## [2.3.2] - 2022-06-11
### Fixed
- [#33](https://github.com/flowwer-dev/pull-request-stats/issues/33) Limits links length to 1,024 characters to prevent `KeyTooLongError` error.
Expand Down
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ The possible inputs for this action are:
| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `token` | `GITHUB_TOKEN` or a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with "repo" permission. | `GITHUB_TOKEN` |
| `token` | A [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-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. 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 the name of your organization 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 length of 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 or not. Possible values: `true` or `false`. | `false` |
| `disable-links` | If `true`, removes the links to the detailed charts. Possible values: `true` or `false`. | `false` |
| `sort-by` | The column used to sort the data. Possible values: `REVIEWS`, `TIME`, `COMMENTS`. | `REVIEWS` |
| `limit` | The maximum number of rows to display in the table. A value of `0` means unlimited. |`0`|
| `publish-as` | Where to publish the results. Possible values: as a `COMMENT`, on the pull request `DESCRIPTION`. | `COMMENT` |
| `telemetry` | Indicates if the action is allowed to send monitoring data to the developer. This data is [minimal](/src/services/telemetry/sendStart.js) and helps me improve this action. **This option is a premium feature reserved for [sponsors](#premium-features-).** |`true`|
| `slack-webhook` | A Slack webhook URL to post resulting stats. **This option is a premium feature reserved for [sponsors](#premium-features-).** |`null`|
| `slack-channel` | The Slack channel where stats will be posted. Include the `#` character (eg. `#mychannel`). Required when a `slack-webhook` is configured. |`null`|
Expand All @@ -65,7 +66,9 @@ Add this to the file `.github/workflows/stats.yml` in your repo:
```yml
name: Pull Request Stats
on: pull_request
on:
pull_request:
types: [opened]
jobs:
stats:
Expand Down Expand Up @@ -99,7 +102,9 @@ Add this to the file `.github/workflows/stats.yml`:
```yml
name: Pull Request Stats
on: pull_request
on:
pull_request:
types: [opened]
jobs:
stats:
Expand Down Expand Up @@ -185,10 +190,17 @@ Suggested sponsorship is $20 usd / month. Thanks for your support! 💙

## Used by

Used by tens of successful teams like:
Used by hundreds of successful teams:

| <a href="https://www.sixt.com/"><img src="https://avatars.githubusercontent.com/u/25441140?s=200&v=4" width="64"></a><br/>Sixt | <a href="https://shop.lululemon.com"><img src="https://avatars.githubusercontent.com/u/17386352?s=200&v=4" width="64"></a><br/>Lululemon | <a href="https://www.deliveryhero.com"><img src="https://avatars.githubusercontent.com/u/7225556?s=200&v=4" width="64"></a><br/>Delivery H | <a href="https://jokr.com/"><img src="https://avatars.githubusercontent.com/u/84920342?s=200&v=4" width="64"></a><br/>JOKR | <a href="http://qatalog.com/"><img src="https://avatars.githubusercontent.com/u/56023495?s=200&v=4" width="64"></a><br/>Qatalog | <a href="https://firework.tv/"><img src="https://avatars.githubusercontent.com/u/25275837?s=200&v=4" width="64"></a><br/>LOOP | <a href="https://www.usehatchapp.com/"><img src="https://avatars.githubusercontent.com/u/38331218?s=200&v=4" width="64"></a><br/>Hatch | <a href="https://www.zenfi.mx/"><img src="https://avatars.githubusercontent.com/u/68744962?s=200&v=4" width="64"></a><br/>Zenfi |
| -- | -- | -- | -- | -- | -- | -- | -- |
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
| <a href="https://www.trivago.com/"><img src="https://avatars.githubusercontent.com/u/1481788?s=200&v=4" width="64"></a><br/>**Trivago** | <a href="https://discovery.com"><img src="https://avatars.githubusercontent.com/u/48454976?s=200&v=4" width="64"></a><br/>**Discovery** | <a href="https://www.additionwealth.com/"><img src="https://avatars.githubusercontent.com/u/86253902?s=200&v=4" width="64"></a><br/>**Addition** | <a href="https://fauna.com/"><img src="https://avatars.githubusercontent.com/u/1477000?s=200&v=4" width="64"></a><br/>**Fauna** | <a href="http://open.cdc.gov/"><img src="https://avatars.githubusercontent.com/u/12104975?s=200&v=4" width="64"></a><br/>**CDC** | <a href="https://www.wecasa.fr/"><img src="https://avatars.githubusercontent.com/u/56955553?s=200&v=4" width="64"></a><br/>**Wecasa** | <a href="https://bolt.eu/"><img src="https://avatars.githubusercontent.com/u/37693190?s=200&v=4" width="64"></a><br/>**Bolt** | <a href="https://republic.com/"><img src="https://avatars.githubusercontent.com/u/18252987?s=200&v=4" width="64"></a><br/>**Republic** |

## Author

|<a href="https://github.com/manuelmhtr"><img src="https://avatars.githubusercontent.com/u/1031639?v=4" width="32"></a>|[@manuelmhtr](https://github.com/manuelmhtr)<br/>🇲🇽 Guadalajara, MX|
| -- | :-- |


## Help

Expand Down
17 changes: 12 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ author: 'Manuel de la Torre'
description: 'Github action to print relevant stats about Pull Request reviewers'
inputs:
token:
description: 'The GitHub authentication token'
description: 'An optional Personal Access Token with enough permissions to fetch all required pull requests to calculate the stats.'
required: false
github-token:
description: 'The default GitHub Token (secrets.GITHUB_TOKEN), used to publish comments as a bot. No need to assign a value for this input.'
required: true
default: ${{ github.token }}
repositories:
Expand All @@ -16,6 +19,10 @@ inputs:
description: 'The length of the period used to calculate the stats, expressed in days'
required: false
default: 30
limit:
description: 'The maximum number of rows to display in the table. A value of `0` means unlimited.'
required: false
default: 0
charts:
description: 'Whether to add charts to the stats or not. Possible values: "true" or "false"'
required: false
Expand All @@ -24,14 +31,14 @@ inputs:
description: 'The column used to sort the data. Possible values: "REVIEWS", "TIME" or "COMMENTS"'
required: false
default: 'REVIEWS'
publish-as:
description: 'Where to publish the results. Possible values: "COMMENT" or "DESCRIPTION"'
required: false
default: 'COMMENT'
disable-links:
description: 'Prevents from adding any external links in the stats'
required: false
default: false
limit:
description: 'The maximum number of rows to display in the table. A value of `0` means unlimited.'
required: false
default: 0
telemetry:
description: 'Indicates if the action is allowed to send monitoring data to the developer.'
required: false
Expand Down
Loading

0 comments on commit 507103c

Please sign in to comment.