Skip to content

CentipawnZ/ai-commit-reporter

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

Repository files navigation

AI Commit Reporter 🤖

A GitHub Action that automatically summarizes commit messages and generates structured release notes or pull request descriptions using AI (OpenAI or Gemini).

Features

  • AI-Powered: Uses LLMs (OpenAI's GPT-4o-mini or Gemini 1.5 Flash) to generate human-readable summaries.
  • PR Comments: Automatically posts the generated report as a comment on Pull Requests.
  • Customizable: Provide your own prompt template to match your team's style.

Usage

Create a workflow file (e.g., .github/workflows/ai-reporter.yml) in your repository:

name: AI Commit Reporter

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  report:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write # Needed for commenting on PRs
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Generate AI Report
        uses: CentipawnZ/ai-commit-reporter@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          llm-provider: 'openai' # or 'gemini', 'custom'
          llm-api-key: ${{ secrets.LLM_API_KEY }}
          # llm-model: 'gpt-4o-mini'
          # llm-base-url: 'https://api.openai.com/v1'
          # output-mode: 'pr_comment' # Default is pr_comment

Inputs

Name Description Required Default
github-token GitHub token for reading commits and commenting Yes N/A
llm-provider LLM provider to use (openai, gemini, or custom) Yes openai
llm-api-key API Key for the chosen provider Yes N/A
llm-model Model to use (e.g., gpt-4o, gemini-1.5-flash) No provider default
llm-base-url Custom Base URL for OpenAI-compatible endpoints No N/A
locale Language of the generated report No English
prompt-template Custom prompt for the AI. Use {{commits}} or {{grouped_commits}} No Built-in template
output-mode Where to output the report (pr_comment) Yes pr_comment

Outputs

  • report: The raw markdown content generated by the AI.

Development

  1. Install dependencies: npm install
  2. Build the project: npm run build
  3. The compiled action will be in the dist folder. Make sure to commit dist/index.js!

About

Summarize commit messages and generate reports using LLMs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors