This Node.js application is designed to listen for GitLab webhook events and automatically generate descriptions for changes made in merge requests using the OpenAI API.
Before you can use this application, make sure you have the following prerequisites installed:
- Node.js (v14 or higher)
- GitLab account and repository
- OpenAI API access
-
Configure your GitLab repository's webhook to point to your application's URL. (https://YOUR_DOMAIN/gitlab) /gitlab at the end is mandatory
-
Make sure you have your OpenAI Token
-
Clone this repository to your local machine:
git clone https://github.com/welarrim/GitAI.git
- Install the required dependencies:
cd your-gitlab-webhook-app
npm install
- Copy .env.example to .env, then change variables in .env
cp .env.example .env
- Start the application:
npm run dev # Start dev env
or
npm run start # Start prod env
Once your application is up and running, it will automatically listen for GitLab webhook events related to merge requests. When a merge request is created or updated, it will send a request to the OpenAI API to generate a description of the changes. You can customize the logic for generating descriptions in your application code.
Contributions are welcome! If you have ideas, bug reports, or want to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name: git checkout -b feature/my-feature or git checkout -b bugfix/issue-description.
- Make your changes and commit them: git commit -m "Description of changes".
- Push your changes to your fork: git push origin feature/my-feature.
- Create a pull request to the main branch of the original repository.
This project is licensed under the MIT License. See the LICENSE file for details.