Aider Issue to PR Workflow
March 23, 2025 ยท View on GitHub
Don't waste time writing code for simple features anymore! Just tag your issues and let AI Automatically generate a PR for you!
See a demo of how it works.
Usage
The recommended way to use this workflow is to call it when an issue is labeled.
- Set
OPENAI_API_KEYsecret in your repository settings. You can get your API key from OpenAI. - Create file
.github/workflows/aider-on-issue-labeled.ymlin your project with the following contents:
name: Auto-generate PR using Aider
on:
issues:
types: [labeled]
jobs:
generate:
uses: mirrajabi/aider-github-workflows/.github/workflows/aider-issue-to-pr.yml@v1.0.0
# Check if the label is 'aider'
if: github.event.label.name == 'aider'
with:
issue-number: ${{ github.event.issue.number }}
base-branch: ${{ github.event.repository.default_branch }}
# Exit if the action is taking longer than 10 minutes
chat-timeout: 10
api_key_env_name: OPENAI_API_KEY
model: o3-mini-2025-01-31
secrets:
api_key_env_value: ${{ secrets.OPENAI_API_KEY }}
Inputs
You can pass the following arguments to the workflow:
| Field Name | Description | Required | Type | Default |
|---|---|---|---|---|
base-branch | Base branch to create PR against | true | string | - |
chat-timeout | Timeout for chat in minutes to prevent burning your credits | false | number | 10 |
issue-number | Issue number | true | number | - |
api_key_env_name | "The name of the environment variable. For example, OPENAI_API_KEY, ANTHROPIC_API_KEY, etc. See more info here | false | string | - |
model | Model to use | true | string | - |
Secrets
| Field Name | Description | Required | Type | Default |
|---|---|---|---|---|
api_key_env_value | The API Key to use as the value of the api_key_env_name | false | string | - |
Example
In aider-github-workflows-test project you can find the following which demonstrate the full flow from Issue to generated PR.
- An issue that triggers the workflow.
- The workflow run
- A Pull request that was created
Roadmap
- Add support for in PR chat and revisions
Disclaimer
You are responsible for the AI credit that is spent. All contributors in a GitHub project will be able to label issues which will trigger the workflow. Non-contributors are not be able to tag issues which helps greatly in preventing abuse.