-
Notifications
You must be signed in to change notification settings - Fork 0
/
slack_notifications_github_enterprise_instructions.txt
executable file
·47 lines (24 loc) · 4.44 KB
/
slack_notifications_github_enterprise_instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Instructions for setting up Github notifications in Slack when your repository is hosted by Github Enterprise
Note: These instructions apply only to repositories hosted on Github Enterprise, not those hosted on github.com. At Georgia Tech, these repositories will be hosted on github.gatech.edu.
Prerequisites: Before beginning with these instructions, make sure you have already set up your repository on github.gatech.edu and that you have already created the Slack channel where you want updates to be posted. Note that you will need administrative access to the repository, but, with default settings, any user in a workspace can link a repository to a channel.
Additionally, verify that the app "GitHub Notifications (Legacy)" is installed in your workspace. (It has already been installed for gtDMMB.)
1. Navigate to https://gtdmmb.slack.com/apps/manage (or the analogous URL for your workspace).
2. Click on "Github Notifications (Legacy)". This should bring you to a page giving some basic information about the app and showing the existing "Configurations," each of which links one repository to a channel.
3. Click on the green "Add Configuration" button.
4. Under "Post To Channel", use the drop-down box to select the channel where you want notifications to appear. Then click the green button labeled "Add Github Integration."
5. Slack will present you with a set of setup instructions. You can click the "close" button to minimize these.
6. In another tab, navigate to your github repository. From the main repository page, click on the tab labeled "Settings." Once on the settings tab, click "Hooks" in the left-hand menu.
7. On the Hooks page (in github repository settings), find the button labeled "Add webhook" and click it.
8. Return to your Slack tab and find the section labeled "Webhook URL." This section has a text field containing a URL. Copy that URL, either using commands in your browser or by clicking on "Copy URL."
9. Return to your github tab and paste the URL you just copied into the field labeled "Payload URL."
10. Still in the github tab, under "Content type" select "application/json." Leave the "Secret" field blank.
11. In the next section, you are asked to decide which events should trigger the webhook. This will determine which events on github will be sent to Slack. In most cases, you will want to select "Send me everything."
12. Make sure the box labeled "Active" is checked. Click the green button "Add webhook." Github should return you to the Hooks settings page, and you should see a status message in a blue bar at the top of your screen indicating that the hook was created successfully. We are now done with configuration in github.
13. Return to your Slack tab. The next section (under the Webhook URL section) is labeled "Branch." In most cases, you will leave this blank. If you want to post updates only from certain branches, list those branches here, separated by commas.
14. The next section "Post to Channel" should already be filled out with the selection you made before, but you can change the destination channel here if you need to.
15. The next field "Descriptive Label" gives you an option to specify more information about this integration. In most cases, the purpose of the integration will be clear from the repository name and you will not need to fill out this field.
16. The field "Customize Name" gives you the option to specify the apparent username under which the github updates will be posted. I have been using names of the form "githook_[repository-name]", but this is purely a cosmetic choice and does not change the functionality of the app.
17. The next section gives you the ability to upload a custom icon to appear with the github notifications. In most cases, the default will be fine and you will not need to do anything here.
18. Finally, review the preview message generated by Slack. If everything looks acceptable, then click on the large green button "Save Integration." Github should return you to the configuration page for the Github Notifications (Legacy) app. You can now close the tab or navigate back to your workspace.
19. To verify that you have correctly configured the integration, you can visit the target channel. You should see a message stating that you have added in integration to the channel and giving the name which you selected in step 16.
Your commits and other github events (e.g. opening issues) should now appear in the Slack channel that you specified!