Development
How to Integrate Github and Slack?

How to Integrate Github and Slack?

In this post, we are going to learn how to integrate Github and Slack, one of the integrations provided by Slack. These two platforms have become an inevitable part of every developer’s life. For those who don’t know about any of the two platforms, there is a brief introduction to each platform in upcoming sections of the post. The reason I chose this topic to write a post when there is no coding involved in this integration, is that every developer whether he is a student or a professional must know about these platforms and how to use them together.



What is Slack?

Slack is a messaging app for teams. It brings all the teams’ communication and files in one place. But here teams does not mean that an individual developer or a student has no use for Slack. What slack provides is a collaborative and separate environment where you can discuss and share with others who are working with you on same project keeping you away from the hassle of other social media platforms. Even you can create a workspace, a slack environment, where you can invite/add members who are passionate about the same topic to learn and grow together. Slack has something for each and every developer supported by “free to use forever” pricing tier. You can watch below video to get a quick idea about “What is slack?”

From the above video Slack can be summarized into below points:

Channels

Slack’s channels help you focus by enabling you to separate messages, discussions, and notifications by purpose or topic.

Private Channels

If you need privacy, Slack provides that as well with invite-only channels.

Direct Messages

When you need to send a message to one person instead of a channel group, Slack provides traditional instant messaging functionality for you to do so and even you can send
direct messages to a group of people.

Share your Files

Sharing documents is one of the basics of collaboration. Slack enables you to share all types of files.

Search

Slacks robust search functionality enables you to find key information quickly, even if it’s inside of a document you’ve shared. But it is limited to the most recent 10,000 messages in free tier.

Notifications

Notifications can be a tricky feature too many and you start ignoring them, too few and something might slip through the cracks. Slack enables you to fine-tune your notifications (by channel, keywords and more) so you can focus on your highest priorities.

Platforms

No matter where you go, Slack can come with you with their mobile apps for iOS, Android.

Price

Slack provides all level of pricing based on your need. But what attracts our eye is its free tier for small teams wanting to try out Slack for an unlimited period of time.

Integration

And this is the feature which is the base of this post. Integration is what takes Slack from a normal online instant messaging and collaboration system to a solution that enables you to centralize all your notifications. Slack provides many pre-built integrations, one of which is Github.

 

What is Github?

GitHub probably does not need any introduction. It has become the lifeline of every open source software and the developers around the world. However, here is a quick refresher on GitHub.

GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git. I am adamant that you already know how to use Git if you are reading this post. You can watch below video to get a quick idea about Github.

 

But why to integrate Github and Slack?

Well, that is the million dollar question that you must be asking. The GitHub integration for Slack helps in keeping a tab on the repositories. This integration will issue notifications to the specified channel in Slack for the following types of events.

  • Commit events
  • Pull requests
  • Issue events
  • Deployment statuses

If you are used to working on Github, you must be aware of how important such events are for a repository. With slack, you get updates about all such events in your Slack workspace/channel. You can do many more things which we will talk about later in this post.

 


 

Now follow the below-given steps to integrate Github and Slack.

 

STEP 1Create a Slack Workspace

If you already have a Slack Workspace you can skip this step, otherwise, follow the points given below.

  • First of all, go to Slack Website.
  • Then fill in your email address with which you want to create a workspace on Slack and click “GET STARTED”.
  • Github Slack Integration Step 1
  • Then select “Create a new workspace” from the list of options provided. A Slack workspace is a space you share with other members to communicate and get work done.
  • Github Slack Integration Step 2
  • Then you will receive a Confirmation Code on the provided email address. Fill this code in the space provided.
  • Github Slack Integration Step 3
  • Then provide your Full Name and Set your Password on Slack.
  • Github Slack Integration Step 4
  • Then decide a name for your group. This group name will be used to name your slack workspace.
  • Github Slack Integration Step 6
  • Then select a name for your workspace and click on Create Workspace.
  • Github Slack Integration Step 6
  • In the last step, you can either send invitations to people to join your workspace or you can skip it. With this, you have created a new workspace on Slack. Follow the next Step to integrate Github and your Slack Workspace.
  • Github Slack Integration Step 8
  • Github Slack Integration Step 8

 

STEP 2Integrate Github into Slack Workspace

Now we will integrate Github into Slack, which is one of the many pre-built integrations provided by Slack. Follow the points given below.

  • In your Slack Workspace, select Administration > Manage Apps from the left sidebar.
  • Github Slack Integration Step 10
  • Then select “Browse the App Directory” from next screen.
  • Github Slack Integration Step 11
  • Search for Github and then select the first one from results. It is the updated version of Github App available for Slack.
  • Github Slack Integration Step 11
  • On Github App page, click on Install.
  • Github Slack Integration Step 13
  • Continue with permission screen.
  • Github Slack Integration Step 14
  • Select No channels on next screen. We will give Github access to each channel separately.
  • Github Slack Integration Step 15
  • Next, it will redirect you to Github App section inside your workspace.
  • Github Slack Integration Step 16
  • Github Slack Integration Step 17
  • Now we will sign in into your Github Account using the following command /github signin. Type this command into the bottom textbox on Github App section.
  • Now click on “Connect Github Account” button. Then Sign In into your Github account. Now your Slack Github App is connected to your Github Account and have access to all your repositories. You can always restrain that into your Github account.
  • Github Slack Integration Step 18
  • Github Slack Integration Step 19
  • Now create a new channel in your workspace or select the channel in which you want to receive notifications/messages related to your repository. I Create a channel named #githubslack. In this channel, type the following command /github subscribe owner/repository. Replace owner with your Github Username and repository with your repository name for which you want to receive messages in this channel. It will first ask you to add @Github in this channel. Click on “Add to this conversation. And then again run the above command.
  • Github Slack Integration Step 23
  • Then a message will be displayed on the channel stating successful subscription to the Github repository.
  • Github Slack Integration Step 24
  • Now you will receive notifications/messages for almost every activity that will happen in the above subscribed Github repository. You can subscribe to as many Github repositories as you like in as many channels you require.
  • Now we have successfully integrated Github into the Slack workspace. Now you can explore the commands available in this integration and experiment with them.



Some Important Points:

Now we will integrate Github into Slack, which is one of the many pre-built integrations provided by Slack. Follow the points given below.

  • Before using /github command in any new channel, you need to add @Github
    to that channel. You can achieve this by running command /invite @github in that channel.
  • You can always find available /github commands using /github help.
  • Github Slack Integration Step 25
  • By default some activity notifications are disabled. You can subscribe to such notifications using command /github subscribe owner/repo [feature]. To learn more visit this link.

 

Now I have given you a brief tour on “How to integrate Github and Slack”. It covers all the necessary steps to get you started. But it is just the tip of all that can be achieved with Slack. To explore more, visit below-given links.

 


If you face any problem in the tutorial above, you can always leave a reply or reach me through the chat option given in the bottom right corner of the window.

Share this Story

Leave a Reply

Your email address will not be published. Required fields are marked *

About Me


I'm a college student pursuing B.tech. I created this website (Blog) to share my learnings with the people who search for the same content/knowledge.