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.
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:
- No repository data is collected, stored, or distributed by this GitHub action. This action is state-less.
- Minimal data is sent to Mixpanel to improve this action. However, you can opt out using the
telemetry
option.
Just add this action to one of your workflow files:
- name: Recap changes
uses: flowwer-dev/recap@main
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. | 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 and helps me improve this action. This option is a premium feature reserved for sponsors. | true |
Minimal config
Add this to the file .github/workflows/recap.yml
in your repo:
name: Pull Request Recap
on:
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.
- Create an account on OpenAI's developers site.
- Go to Config > View API Keys.
- Press the
Create new secret key
button and copy the value. - Voilà!
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
configuration in the workflow file. The minimum required permissions are contents: read
and pull-requests: write
:
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".
- Check the sponsorship comes from the account that owns the configured repository (usually an organization).
- Ensure the sponsorship is configured as
public
; otherwise, the action cannot access the sponsorship information. If you prefer to keep itprivate
, please reach out to make it work for you that way 😉.
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.
Thanks for your support! 💙
- Pull Request Stats: Github action to print relevant stats about Pull Request reviewers.
@manuelmhtr 🇲🇽 Guadalajara, MX |
---|
This project is maintained by a single person, considering supporting the project by:
- ⭐ Star this repo.
- Becoming a sponsor.
MIT