Skip to content

Action for using Relgen — an AI powered PR reviewer, summarizer, and labeler

License

Notifications You must be signed in to change notification settings

zlalvani/relgen-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relgen Action

This action uses relgen to automatically review, describe, and label pull requests using AI.

Features

  • 🤖 AI-powered PR reviews and descriptions
  • 🏷️ Intelligent PR labeling
  • ⚙️ Customizable templates and prompts
  • 🔄 Updates on PR changes

Usage

name: PR Assistant
on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  relgen:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
      issues: write
    steps:
      - uses: actions/checkout@v4
      - uses: zlalvani/relgen-action@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          llm-key: ${{ secrets.OPENAI_API_KEY }} # or ANTHROPIC_API_KEY or DEEPSEEK_API_KEY
          llm-provider: openai # or anthropic or deepseek
          llm-model: gpt-4o-mini # or claude-3-sonnet-20240229 or deepseek-chat etc

Inputs

Input Description Required Default
github-token GitHub token for API access Yes N/A
llm-key LLM API key (OpenAI or Anthropic) Yes N/A
llm-provider LLM provider (openai or anthropic) Yes openai
llm-model Model to use (e.g. gpt-4o-mini for OpenAI or claude-3-sonnet-20240229 for Anthropic) Yes N/A
description-template Path to description template file No Default template
description-prompt Path to description prompt file No Default prompt
write-mode Where to write descriptions (comma-separated list of: title,comment,description or off to disable) No comment
label-mode How to write labels (add, set, or off) No add
review-mode How to write reviews (add or off) No add
footer Footer text used to identify relgen comments No Default footer with link to action
verbose Enable verbose logging No false
config Path to relgen config file No N/A

Customization

Templates

Create a markdown template file (e.g. .github/templates/pr-description.md):

### Changes
A bullet point list of the important changes

### Implementation
Technical details of the implementation

### Other Notes
Additional context or minor changes

Prompts

Create a prompt file (e.g. .github/prompts/pr-description.txt):

Focus on the technical impact of the changes.
Highlight any breaking changes.
Include performance implications.

Then update your workflow:

- uses: zlalvani/relgen-action@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    llm-key: ${{ secrets.OPENAI_API_KEY }} # or ANTHROPIC_API_KEY
    llm-provider: openai # or anthropic
    llm-model: gpt-4o-mini # or claude-3-sonnet-20240229 etc
    write-mode: title,comment,description # Write to PR title, comment and description
    description-template: .github/templates/pr-description.md
    description-prompt: .github/prompts/pr-description.txt

Configuration File

You can use a configuration file to manage your settings and add custom review rules. Create a .relgen.json file:

{
  "commands": {
    "remote": {
      "pr": {
        "review": {
          "rules": [{ "file": ".github/relgen/my-rule.md" }, "follow martin fowler's service layer pattern"]
        }
      }
    }
  }
}

Then reference it in your workflow:

- uses: zlalvani/relgen-action@v1
  with:
    config: .github/.relgen.json

About

Action for using Relgen — an AI powered PR reviewer, summarizer, and labeler

Resources

License

Stars

Watchers

Forks

Packages

No packages published