This GitHub Action automatically creates or updates a Pull Request from a development branch to the default branch, generates descriptive PR content with OpenAI, Claude or OpenRouter, and adds relevant reviewers.
- π Automatically creates or updates a PR from dev to the default branch
- π€ Generates PR descriptions with OpenAI (default), Claude or OpenRouter β one script per provider in
providers/ - π₯ Automatically adds relevant reviewers
- π Sets PR title with current date (e.g., "Release v2023.05.25")
| Name | Description | Required | Default |
|---|---|---|---|
provider |
openai, claude or open-router (env AI_PROVIDER) |
No | 'openai' |
model |
Model for the provider (env AI_MODEL) |
No | openai: 'gpt-6-luna', claude: 'claude-haiku-5-5', open-router: 'deepseek/deepseek-v4.1-flash' |
openai_api_key |
OpenAI API key (env OPENAI_API_KEY) |
For openai |
N/A |
anthropic_api_key |
Anthropic API key (env ANTHROPIC_API_KEY / CLAUDE_API_KEY) |
For claude |
N/A |
anthropic_workspace_id |
Only for Anthropic keys not scoped to a workspace (env ANTHROPIC_WORKSPACE_ID) |
No | N/A |
openrouter_api_key |
OpenRouter API key (env OPENROUTER_API_KEY) |
For open-router |
N/A |
openai_model |
Deprecated alias of model for openai |
No | N/A |
github_token |
GitHub Personal Access Token with repo permissions | Yes | N/A |
dev_branch |
Name of the development branch | No | 'dev' |
max_diff_bytes |
Max size (bytes) of the diff payload sent to the model | No | '200000' |
| Name | Description |
|---|---|
pr_number |
The number of the pull request created or updated |
To use this action in your workflow, add the following step:
- name: Auto PR from Dev to Default
uses: yuri-val/auto-pr-action@v1
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
model: gpt-6-luna # Optional, the openai default
github_token: ${{ secrets.GITHUB_TOKEN }}
dev_branch: dev # Optional, defaults to 'dev'Make sure to set up the secret for your provider (OPENAI_API_KEY, ANTHROPIC_API_KEY or OPENROUTER_API_KEY).
To use another provider, set it by input or once for the whole job by environment variable (inputs win):
env:
AI_PROVIDER: claude
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}Measured 2026-10-10 on three real PRs and one 5-commit release (all eight candidates followed the output rules; times and costs are per description):
| Provider / model | Character | Avg time | Cost |
|---|---|---|---|
openai / gpt-6-luna |
shortest, accurate, fewest tokens | 3.5 s | $0.0007 |
openai / gpt-5.6-luna |
accurate, somewhat generic | 4.7 s | $0.0016 |
claude / claude-haiku-5-5 |
most specific; the only model to catch every non-obvious change (e.g. a changed default with an upgrade note) | 4.7 s | $0.0014 |
open-router / deepseek/deepseek-v4.1-flash |
detailed and accurate | 4.4 s | $0.0028 |
open-router / z-ai/glm-5.3-flash |
detailed, occasional overstatement | 13.9 s | $0.0012 |
open-router / xiaomi/mimo-v2.6-flash |
detailed, slower | 15.8 s | $0.0011 |
open-router / google/gemini-3.8-flash |
concise, odd grouping, most expensive | 4.6 s | $0.0067 |
open-router / qwen/qwen3.8-flash |
long, very slow | 57.9 s | $0.0025 |
Create a workflow file in your repository (e.g., .github/workflows/auto-pr.yml):
name: Auto PR from dev to default
on:
push:
branches:
- dev
jobs:
auto-pr:
runs-on: ubuntu-latest
# The PR is created with the PAT; the job token only needs to read the repo.
permissions:
contents: read
steps:
- name: Run Auto PR Action
uses: yuri-val/auto-pr-action@v1
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
github_token: ${{ secrets.PAT_TOKEN }}
dev_branch: 'dev' # Optional, defaults to 'dev'
- Checks out the repository
- Sets up Git configuration
- Determines the default branch
- Generates a diff between the dev and default branches
- Uses the chosen provider (OpenAI, Claude or OpenRouter) to generate a descriptive PR content
- Creates a new PR or updates an existing one
- Adds relevant reviewers to the PR β the commit authors (real users only; bots and the organisation account are skipped), plus the repository owner for personal repositories
The commit log, the per-file diffstat and the diff between the branches, capped at
max_diff_bytes. The contents of secret-bearing files β .env*, *.pem, *.key,
*.p12/*.pfx/*.jks, SSH keys, .npmrc/.netrc, credentials.yml*/secrets.yml* and
similar β are excluded from the diff; they appear in the diffstat by name only.
Generated files β dist/, *.min.js/*.min.css, source maps and lockfiles
(package-lock.json, yarn.lock, Gemfile.lock, go.sum, ...) β are left out of the diff too,
so a rebuilt bundle cannot push the real changes out of the max_diff_bytes budget; they also
stay in the diffstat.
- Default Branch:
mainormaster - Development Branch:
dev - Feature Branches: Multiple branches like
feature/new_awesome_feature,feature/new_files, etc.
-
Branch Creation:
- The
devbranch is created from the default branch (mainormaster). devalways contains all commits from the default branch.
- The
-
Feature Development:
- Multiple feature branches are created from
dev. - Examples:
feature/new_awesome_feature,feature/new_files, etc. - Developers work on these feature branches.
- Multiple feature branches are created from
-
Feature Integration:
- When a feature is complete, it is merged into the
devbranch.
- When a feature is complete, it is merged into the
-
Automated Pull Request Creation/Update:
- On every merge to
dev(or any push todev):- An automated process creates or updates a Pull Request from
devto the default branch (mainormaster). - The Pull Request description is automatically generated by the configured provider (OpenAI by default).
- This ensures that the default branch is always aware of changes in
dev.
- An automated process creates or updates a Pull Request from
- On every merge to
-
Continuous Integration:
- The
devbranch continuously integrates new features. - The automated PR to the default branch is kept up-to-date with these changes.
- The
-
Review and Merge:
- The auto-generated PR can be reviewed and eventually merged into the default branch when ready.
This workflow allows for organized feature development, continuous integration into the dev branch, and an always up-to-date PR to the default branch with AI-generated descriptions for easy review and merging.
Contributions are welcome! Please feel free to submit a Pull Request.
This README.md provides an overview of your GitHub Action, including its features, inputs, outputs, and usage instructions. It also briefly explains how the action works and includes sections for licensing and contributions.
You may want to adjust the "Usage" section to reflect the correct GitHub username or organization where this action will be published. Also, if you haven't already, you might want to add a LICENSE file to your repository.
Feel free to modify this README to better fit your project's specific needs or to add any additional information you think would be helpful for users of your GitHub Action.
