GitHub Action
PR Auto Describe
v0.9.0
Latest version
Automatically generate descriptions for pull requests using AI.
When you open or update a pull request labeled with "ai-describe", this action will automatically generate a concise list of changes for pull requests and post them as comments on the pull request.
The Action categorizes each change by its type (e.g., 'Refactor', 'Bug Fix', 'Optimization') for an easy-to-understand summary.
- GitHub API token for API access.
- OpenAI API key for fetching AI suggestions.
To use this action in your GitHub repository, follow these steps:
- In your GitHub repository, add a secret named
OPENAI_API_KEY
that contains your OpenAI API key. - Similarly, add a secret named
TOKEN
with your GitHub API token that grants access to the repository. - Add the following workflow file to your repository in the
.github/workflows
directory, and name itpr-auto-describe.yml
:
on:
pull_request:
types: [synchronize, reopened, labeled]
jobs:
describe:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: PR Auto Describe
uses: salehhashemi1992/pr-auto-describe@main
with:
github-token: ${{ secrets.TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
openai-model: 'gpt-4' # Optional, you can use 'gpt-3.5-turbo' or 'gpt-4-32k' as well.
github-api-base-url: 'https://api.github.com' # Optional, defaults to 'https://api.github.com'
The action accepts the following inputs:
Input | Required | Description |
---|---|---|
github-token |
Yes | The GitHub API token for accessing the repository. |
openai-api-key |
Yes | The API key for accessing the OpenAI API. |
openai-model |
No | Supported values are 'gpt-3.5-turbo', 'gpt-4', and 'gpt-4-32k'. Defaults to 'gpt-3.5-turbo'. |
openai-api-base-url |
No | The base URL for the GitHub API. Defaults to 'https://api.github.com'. |
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.