This is a simple Slack bot that listens to messages in a channel, and when it finds a (single) message linking to a Gitlab MR or a diff between tags, it will send the contents to OpenAI and post back a summary of changes as a reply to the original message.
- Python 3.11 or higher
- Poetry
- A previously set-up and installed Slack app
- Make sure to subscribe to the
message.channels
event in the Slack app settings. - Access to a Gitlab repo and a personal access token with the
api
scope.
- Make a copy of
.env.sample
and rename it to.env
. - Fill in the required environment variables in the
.env
file. - Install dependencies in whatever env you like with
poetry install
. - Run the app with
python main.py
- Expose through ngrok:
ngrok http 3000
(or whatever port you are using) - Get the ngrok URL and paste it in the
Request URL
field in the Slack app settings. (make sure to add/slack/events
at the end of the URL)