https://github.com/flowwer-dev/recap
Github action to summarize the most important changes in a pull request
https://github.com/flowwer-dev/recap
Last synced: 2 months ago
JSON representation
Github action to summarize the most important changes in a pull request
- Host: GitHub
- URL: https://github.com/flowwer-dev/recap
- Owner: flowwer-dev
- License: mit
- Created: 2023-03-20T02:28:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-25T05:27:42.000Z (over 2 years ago)
- Last Synced: 2024-12-01T19:42:02.024Z (7 months ago)
- Language: JavaScript
- Size: 370 KB
- Stars: 26
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ⚡️ Recap
[](https://github.com/flowwer-dev/recap/actions?query=workflow%3ATests)
[](https://github.com/marketplace/actions/pull-request-recap)Tired of writing long pull request descriptions? or worse, not writing them at all?
This Github action will summarize the most significant changes in a pull request using [GPT](https://openai.com/blog/chatgpt).
The objective of this action is to:
* Reduce the time spent writing the pull request description.
* Help developers understand the changes before reviewing them.Running this action will add a comment to the pull request summarizing the changes. [For example](https://github.com/flowwer-dev/recap/pull/1#issuecomment-1476682437):

## Privacy
* **No repository data is collected**, stored, or distributed by this GitHub action. This action is **state-less**.
* [Minimal data](/src/services/telemetry/sendStart.js) is sent to Mixpanel to improve this action. However, you can opt out using the `telemetry` option.## Usage
Just add this action to one of your [workflow files](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow):
```yml
- name: Recap changes
uses: flowwer-dev/recap@main
```### Action inputs
The possible inputs for this action are:
| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `openai-apikey` | An API Key for your OpenAI account. This parameter is **required**. Check how to get an API [here](#how-the-get-an-openai-api-key). | `null` |
| `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`|## Examples
**Minimal config**
Add this to the file `.github/workflows/recap.yml` in your repo:
```yml
name: Pull Request Recapon:
pull_request:
types: [opened]jobs:
recap:
runs-on: ubuntu-latest
steps:
- name: Recap changes
uses: flowwer-dev/recap@main
with:
openai-apikey: ${{ secrets.ADD_YOUR_OPENAI_APIKEY }}
```This config will:
* Recap the most significant changes included in the Pull Request.
* Post them as a comment.## How the get an OpenAI API Key?
1. Create an account on [OpenAI's developers site](https://platform.openai.com/docs/api-reference).
2. Go to Config > [View API Keys](https://platform.openai.com/account/api-keys).
3. Press the `Create new secret key` button and copy the value.
4. Voilà!## Troubleshooting
I get the error "Error commenting on the pull request...".
This error happens when the organization configures the action's permissions as `read`. To fix it, overwrite them by adding a [`permissions`](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) configuration in the workflow file. The minimum required permissions are `contents: read` and `pull-requests: write`:
```yml
jobs:
recap:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Run pull request recap
uses: flowwer-dev/recap@main
```I'm a sponsor but still getting the error "...is a premium feature, available to sponsors".
1. Check the sponsorship comes from the account that owns the configured repository (usually an organization).
2. Ensure the sponsorship is configured as `public`; otherwise, the action cannot access the sponsorship information. If you prefer to keep it `private`, please reach out to make it work for you that way 😉.## Premium features ✨
This action offers some premium features only for sponsors:
* Disabling telemetry.
* More coming soon.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 my [other projects](#related-projects).
Thanks for your support! 💙
## Related projects 🔥
* **[Pull Request Stats](https://github.com/flowwer-dev/pull-request-stats)**: Github action to print relevant stats about Pull Request **reviewers**.
## Author
|
|[@manuelmhtr](https://github.com/manuelmhtr)
🇲🇽 Guadalajara, MX|
| -- | :-- |## Help
This project is maintained by a single person, considering supporting the project by:
* ⭐ Star this repo.
* Becoming a [sponsor](https://github.com/sponsors/manuelmhtr).### License
MIT