Home

Awesome

⚡️ Recap

CI GitHub Marketplace

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:

Running this action will add a comment to the pull request summarizing the changes. For example:

Privacy

Usage

Just add this action to one of your workflow files:

      - name: Recap changes
        uses: flowwer-dev/recap@main

Action inputs

The possible inputs for this action are:

ParameterDescriptionDefault
openai-apikeyAn API Key for your OpenAI account. This parameter is required. Check how to get an API here.null
publish-asWhere to publish the results. Possible values: as a COMMENT, on the pull request DESCRIPTION.COMMENT
telemetryIndicates 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

Examples

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:

How the get an OpenAI API Key?

  1. Create an account on OpenAI's developers site.
  2. Go to Config > View API Keys.
  3. Press the Create new secret key button and copy the value.
  4. Voilà!

Troubleshooting

<details> <summary>I get the error "Error commenting on the pull request...".</summary>

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
</details> <details> <summary>I'm a sponsor but still getting the error "...is a premium feature, available to sponsors".</summary>
  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 😉.
</details>

Premium features ✨

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 my other projects.

Thanks for your support! 💙

Related projects 🔥

Author

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

Help

This project is maintained by a single person, considering supporting the project by:

License

MIT