Are you looking for how to do GitLab and Slack integration?. I recently did a new setup of GitLab server to be used by the company for internal projects. After completing the setup, I looked at ways to get notifications for all GitLab project actions – Push, Merge requests, issues, notes e.t.c.
Since we use Slack as a primary communication channel, it was for a fact we had to do Slack and GitLab integration. In this guide, I’ll share with you the steps I used to setup GitLab and Slack Integration for notifications.
If you don’t have GitLab already installed, refer to our installation guides:
How to configure GitLab and Slack Integration
Once you have both GitLab and Slack services working. Below are the steps you’ll follow to get the integration working.
- Create Slack Channel for GitLab project
- Get the Webhook URL for the channel
- Configure Webhook URL in GitLab Project.
Step 1: Create Slack Channel
Sign in to your Slack team and start a new Incoming WebHooks configuration. If you have Channel already created, choose it from the “Choose a channel” dropdown.
If you don’t have a Channel created, click the “create a new channel” link.
Fill Channel details, to be specific:
- Select if Channel is
Public– This will likely be Private where you invite members to the channel.
- Channel name
- Purpose of the channel – Description
- For Private channel, select list of guys to send invites to – This can be done later
When done, click on “Create Channel“. Confirm that the correct channel has been chosen then
Add Incoming WebHooks integration
Copy the given Webhook URL and proceed to Step 2.
Step 2: Configure Webhook URL on GitLab
1.Login to your GitLab Dashboard and navigate to Project > Settings > Integrations.
2.Under the “Integrations” section, click on “Slack notifications” to activate it.
Check the Active checkbox to turn on the service.
4.Paste the Webhook URL that you copied from the Slack Configuration step inside
5. Click on “Test settings and save changes” to validate your settings.
If the configuration was successful, you should receive a test commit message in your Slack channel.
There you go!. You have successfully integrated your GitLab project and Slack channel to receive notifications for all repository events.