Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Ai Commit Message

Actions
Automatically generate a commit message using AI power
v0.2.0
Star (31)

AI Commit Message Generator GitHub Action

This GitHub Action automatically generates commit messages and descriptions for your commits using AI.

When you make a commit with the title [ai], this action will analyze the commit changes, use AI to generate a commit title and description, and update the commit message accordingly.

Sample Output

Features

  • Automatically generates meaningful commit titles and descriptions for your commits
  • Utilizes AI to analyze commit changes and generate relevant commit messages
  • Maintains the original author of the commit (committer name and email)

Usage

To use this action in your GitHub repository, follow these steps:

  1. Add a secret named OPENAI_API_KEY in your GitHub repository containing your OpenAI API key.

  2. Add the following workflow file to your repository in the .github/workflows directory, and name it ai_commit_message_generator.yml:

name: AI Commit Message Generator

on: [push]

jobs:
  ai_commit_message:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Replace commit message with AI-generated title
        uses: salehhashemi1992/[email protected]
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Now, whenever you push a commit with the title [ai], this action will automatically generate a commit title and description using AI and update the commit message accordingly.

Known Bugs

If you push a new commit before the title of the last commit has been updated, it will result in an issue where only the last commit title gets updated. To avoid this problem, please make sure to wait for the previous commit's title to be updated before pushing a new commit.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Ai Commit Message is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Automatically generate a commit message using AI power
v0.2.0

Ai Commit Message is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.