AIPR (AI-Powered Pull Request) is a Github action designed to streamline issue resolution and improve collaboration within project teams. This action uses ChatGPT by OpenAI to create a pull request (PR) for issues labeled "AIPR" in the repository. The PR created by AIPR contains a solution generated by ChatGPT.
This action is designed to make it faster and easier to resolve issues and improve the overall efficiency of software development teams.
- When an issue is labeled "AIPR" in a project repository, the AIPR Github action is triggered.
- The action uses the issue description and comments to generate a solution using ChatGPT.
- The solution is added to a new PR and pushed to the repository.
- Project collaborators can review the solution and merge the PR if they decide it is appropriate.
Go to the AIPR project on marketplace AIPR on Github Marketplace and follow the instructions:
In order to have the Action fully work, you need first Allow Github actions to create and approve Pull Requests
First go to your project settings and go to Actions / General
Then enable the Allow Github actions to create and approve Pull Requests option as on the images below
- Improve documentation
- File refactoring
- Fix bugs and many others
Here's an example of documentation in my profile, that I would like to use AIPR to change it
Then I created an issue asking to change the file content to add a new section about my hobbies
When you add a label AIPR it will trigger the action and you will receive a PR with a solution for that issue
The Github action will run and it will call the OPEN AI API to create a solution for your issue based in your configuration and OPEN AI token provided
A Pull Request will be send with the solution
You can see the diff and review the code from AIPR
You can see the diff and review the code from AIPR
There are a few limitations to keep in mind when using AIPR, including:
- AIPR only works for one file, so you need to specify the file in the format './filename.ext', a relative path to the repository.
- To ensure the most accurate solution, it is important to be as descriptive as possible in the issue description and comments.
Add a section on the bottom of the file './README.md' about the author of the project, Alexandre Magno (https://github.com/alexanmtz). #10
- Install the AIPR Action on the marketplace: https://github.com/marketplace/actions/creates-a-pr-to-solve-an-issue-using-chatgpt.
- Label an issue in your project repository with "AIPR".
- Once the issue is labeled, the AIPR Github action will automatically create a PR to solve the issue using ChatGPT.
- Alternatively, you can manually trigger AIPR by commenting on the issue, such as "Create PR with AIPR 🚀." This will also create a PR using ChatGPT.
A sample workflow file AIPR.yaml
inside the workflow folder could look like this:
on:
issues:
types: [labeled, reopened]
issue_comment:
types: [created]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
Creating-PR-using-AIPR:
if: ${{ (github.event_name == 'issues' &&
contains ( github.event.label.name, 'AIPR')) ||
(github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains( github.event.comment.body, 'Create PR with AIPR 🚀')) }}
runs-on: ubuntu-latest
steps:
- name: Executing AIPR action
uses: alexanmtz/AIPR@main
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
openai_tokens: 200 #default is 200
target_branch: main
file_chunks: 10000 # split processing in chunks
This project was created by Alexandre Magno (https://github.com/alexanmtz).
Generated by AIPR