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.

  1. Set OPENAI_API_KEY secret in your repository settings. You can get your API key from OpenAI.
  2. Create file .github/workflows/aider-on-issue-labeled.yml in 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 NameDescriptionRequiredTypeDefault
base-branchBase branch to create PR againsttruestring-
chat-timeoutTimeout for chat in minutes to prevent burning your creditsfalsenumber10
issue-numberIssue numbertruenumber-
api_key_env_name"The name of the environment variable. For example, OPENAI_API_KEY, ANTHROPIC_API_KEY, etc. See more info herefalsestring-
modelModel to usetruestring-

Secrets

Field NameDescriptionRequiredTypeDefault
api_key_env_valueThe API Key to use as the value of the api_key_env_namefalsestring-

Example

In aider-github-workflows-test project you can find the following which demonstrate the full flow from Issue to generated PR.

  1. An issue that triggers the workflow.
  2. The workflow run
  3. 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.