This GitHub Action automatically generates pull request descriptions using GPT-4 via the gpt4free library when a PR is created or updated.
- Automatically generates detailed PR descriptions based on the diff between branches
- Uses GPT-4 or other models for intelligent and context-aware descriptions
- Customizable temperature setting for generation
- Supports different G4F providers
- Preserves original PR description as a comment
- Handles retries in case of generation failures
To use this action in your workflow, add the following step to your .github/workflows/main.yml
file:
name: Auto-generate PR Description
on:
pull_request:
types: [opened, synchronize]
jobs:
generate-pr-description:
runs-on: ubuntu-latest
steps:
- name: Generate PR Description
uses: yuri-val/auto-pr-description-g4f-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
temperature: 0.7
provider: auto
model: gpt-4
Input | Description | Required | Default |
---|---|---|---|
github_token |
GitHub token with repo permissions | Yes | ${{ github.token }} |
temperature |
Sampling temperature for gpt4free (0.0 to 1.0) | No | 0.7 |
provider |
G4F provider to use docs | No | auto |
model |
Model to use with the selected provider docs | No | gpt-4 |
Output | Description |
---|---|
pr_number |
The number of the pull request updated |
description |
The generated pull request description |
To set up this project locally:
-
Clone the repository:
git clone https://github.com/yuri-val/auto-pr-description-g4f-action.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Make your changes to the
main.py
file. -
Test your changes locally before creating a pull request.
Contributions, issues, and feature requests are welcome! Feel free to check issues page if you want to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.
Yuri V