A GitHub Action that automatically summarizes commit messages and generates structured release notes or pull request descriptions using AI (OpenAI or Gemini).
- 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.
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| 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 |
report: The raw markdown content generated by the AI.
- Install dependencies:
npm install - Build the project:
npm run build - The compiled action will be in the
distfolder. Make sure to commitdist/index.js!